Only show the available translation for the posts

This commit is contained in:
Emruz Hossain 2020-09-04 21:54:50 +06:00
parent dbff898bf3
commit 856a1b185f
8 changed files with 61 additions and 9 deletions

View 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 }}