mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
🐛 Fix deprecated language redirect locale access #3108
This commit is contained in:
1 parent
51a361e068
commit
48b11026e8
1 file changed
+2
-2
@@ -2,7 +2,7 @@
|
||||
{{ if and ($params.enabled | default false) hugo.IsMultilingual }}
|
||||
{{ $translations := slice }}
|
||||
{{ range .AllTranslations }}
|
||||
{{ $translations = $translations | append (dict "lang" .Language.Lang "languageCode" (.Language.LanguageCode | default "") "url" .RelPermalink) }}
|
||||
{{ $translations = $translations | append (dict "lang" .Language.Lang "languageCode" (.Language.Locale | default "") "url" .RelPermalink) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $browserRedirectHomeOnly := true }}
|
||||
@@ -20,7 +20,7 @@
|
||||
{{ $fallbackLanguage = . }}
|
||||
{{ end }}
|
||||
|
||||
{{ $config := dict "enabled" true "storageKey" ($params.storageKey | default "blowfish_preferred_language") "fallbackLanguage" $fallbackLanguage "browserRedirectHomeOnly" $browserRedirectHomeOnly "storedLanguageRedirect" $storedLanguageRedirect "currentLanguage" .Language.Lang "currentLanguageCode" (.Language.LanguageCode | default "") "isHome" .IsHome "translations" $translations }}
|
||||
{{ $config := dict "enabled" true "storageKey" ($params.storageKey | default "blowfish_preferred_language") "fallbackLanguage" $fallbackLanguage "browserRedirectHomeOnly" $browserRedirectHomeOnly "storedLanguageRedirect" $storedLanguageRedirect "currentLanguage" .Language.Lang "currentLanguageCode" (.Language.Locale | default "") "isHome" .IsHome "translations" $translations }}
|
||||
<script>
|
||||
window.BlowfishLanguageRedirectConfig = {{ $config | jsonify | safeJS }};
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user