Add i18n.LangIsRTL func

This commit is contained in:
Matt Baer
2018-10-16 20:38:27 -04:00
parent 73bffef9af
commit 567e0c6ef0
+21
View File
@@ -0,0 +1,21 @@
package i18n
var rtlLangs = map[string]bool{
"ar": true, // Arabic
"dv": true, // Divehi
"fa": true, // Persian (Farsi)
"ha": true, // Hausa
"he": true, // Hebrew
"iw": true, // Hebrew (old code)
"ji": true, // Yiddish (old code)
"ps": true, // Pashto, Pushto
"ur": true, // Urdu
"yi": true, // Yiddish
}
func LangIsRTL(lang string) bool {
if _, ok := rtlLangs[lang]; ok {
return true
}
return false
}