Skip to content

Commit

Permalink
fix: use language codes as locales as is
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 15, 2024
1 parent f70b1af commit ed32d25
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
4 changes: 0 additions & 4 deletions layouts/partials/decap-cms/functions/locale.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
{{- $map := partialCached "decap-cms/functions/locales-map" . }}
{{- $locale := site.Language.LanguageCode }}
{{- with index $map $locale }}
{{- $locale = . }}
{{- end }}
{{- return $locale }}
7 changes: 0 additions & 7 deletions layouts/partials/decap-cms/functions/locales-map.html

This file was deleted.

7 changes: 1 addition & 6 deletions layouts/partials/decap-cms/functions/locales.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{{- $map := partialCached "decap-cms/functions/locales-map" . }}
{{- $locales := slice }}
{{- range site.Languages }}
{{- with index $map .LanguageCode }}
{{- $locales = $locales | append . }}
{{- else }}
{{- $locales = $locales | append .LanguageCode }}
{{- end }}
{{- $locales = $locales | append .LanguageCode }}
{{- end }}
{{- return $locales }}

0 comments on commit ed32d25

Please sign in to comment.