hugo-toha/layouts/partials/helpers/country-code.html
2021-01-08 23:30:20 +06:00

15 lines
499 B
HTML

{{ $languageCode:= .Lang }}
{{/* 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. */}}
{{ if eq $languageCode "en" }}
{{ $countryCode = "gb" }}
{{ else if eq $languageCode "bn" }}
{{ $countryCode = "bd" }}
{{ else if eq $languageCode "hi" }}
{{ $countryCode = "in" }}
{{ end }}
{{/* return the country code */}}
{{ return $countryCode }}