Allow overwriting country flag for a language (#316)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2021-05-17 23:43:06 +06:00 committed by GitHub
parent 6a01c1ea4b
commit 16f64aa4c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -2,7 +2,7 @@
{{/* by default the language code and the country code are same */}}
{{ $countryCode:= $languageCode }}
{{/* language code and country code are not same for some countries. we need to fix them. */}}
{{/* language code and country code are not same for some countries. we need to fix them. */}}
{{ if eq $languageCode "en" }}
{{ $countryCode = "gb" }}
{{ else if eq $languageCode "bn" }}
@ -11,5 +11,13 @@
{{ $countryCode = "in" }}
{{ end }}
{{/* if the user specify a country code for a language via "params.flagOverwrites" field, then use it. */}}
{{ range site.Params.flagOverwrites }}
{{ if eq $languageCode .languageCode }}
{{ $countryCode = .countryCode }}
{{ end }}
{{ end }}
{{/* return the country code */}}
{{ return $countryCode }}