added country code for LK
This commit is contained in:
parent
ec50da5a5f
commit
6cf5450d47
1 changed files with 9 additions and 8 deletions
|
@ -1,19 +1,20 @@
|
||||||
{{/* if there is no custom flag provided, we define the flag with the country code */}}
|
{{/* if there is no custom flag provided, we define the flag with the country code */}}
|
||||||
{{ $languageCode := .Lang }}
|
{{ $languageCode := .Lang }}
|
||||||
{{/* by default the language code and the country code are same */}}
|
{{/* by default, the language code and the country code are the same */}}
|
||||||
{{ $countryCode := $languageCode }}
|
{{ $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 the same for some countries. we need to fix them. */}}
|
||||||
{{ if eq $languageCode "en" }}
|
{{ if eq $languageCode "en" }}
|
||||||
{{ $countryCode = "gb" }}
|
{{ $countryCode = "gb" }}
|
||||||
{{ else if eq $languageCode "bn" }}
|
{{ else if eq $languageCode "bn" }}
|
||||||
{{ $countryCode = "bd" }}
|
{{ $countryCode = "bd" }}
|
||||||
{{ else if eq $languageCode "hi" }}
|
{{ else if eq $languageCode "hi" }}
|
||||||
{{ $countryCode = "in" }}
|
{{ $countryCode = "in" }}
|
||||||
|
{{ else if eq $languageCode "si" }}
|
||||||
|
{{ $countryCode = "lk" }} {{/* Add this line to set the country code for Sri Lanka */}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* if the user specifies a country code for a language via "params.flagOverwrites" field, then use it. */}}
|
||||||
{{/* if the user specify a country code for a language via "params.flagOverwrites" field, then use it. */}}
|
|
||||||
{{ range site.Params.features.flags.flagOverwrites }}
|
{{ range site.Params.features.flags.flagOverwrites }}
|
||||||
{{ if eq $languageCode .languageCode }}
|
{{ if eq $languageCode .languageCode }}
|
||||||
{{ $countryCode = .countryCode }}
|
{{ $countryCode = .countryCode }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue