Only show the available translation for the posts
This commit is contained in:
parent
dbff898bf3
commit
856a1b185f
8 changed files with 61 additions and 9 deletions
13
layouts/partials/helpers/country-code.html
Normal file
13
layouts/partials/helpers/country-code.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ $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" }}
|
||||
{{ end }}
|
||||
|
||||
{{/* return the country code */}}
|
||||
{{ return $countryCode }}
|
Loading…
Add table
Add a link
Reference in a new issue