def _guess_lang(self): """ Try to guess lang based on the system default language """ localelang = get_locale_lang() if localelang == None: localelang = self.DEFAULT_LANG else: # Take care of exceptions if localelang == 'zh_CN': localelang = 'lang_zh-CN' elif localelang == 'zh_TW': localelang = 'lang_zh-TW' else: localelang = 'lang_' + localelang.split("_")[0] # Check if the language is supported for name, code in LANGUAGES: if code == localelang: return localelang # Set fallback localelang = self.DEFAULT_LANG return localelang
def _guess_lang(self): """ Try to guess lang based on the system default language """ localelang = get_locale_lang() if localelang == None: localelang = self.DEFAULT_LANG else: # Take care of exceptions if localelang == 'zh_CN': localelang = 'lang_zh-CN' elif localelang == 'zh_TW': localelang = 'lang_zh-TW' else: localelang = 'lang_' + localelang.split("_")[0] # Check if the language is supported for name, code in LANGUAGES: if code == localelang: return localelang # Set fallback localelang = self.DEFAULT_LANG return localelang
def _guess_lang(self): """ Try to guess lang """ localelang = get_locale_lang() if localelang == None: localelang = self.DEFAULT_LANG else: localelang = localelang.split("_")[0] # Check if the language is supported for name, code in LANGUAGES: if code == localelang: return localelang # Set fallback localelang = self.DEFAULT_LANG return localelang
def _guess_lang(self): """ Try to guess lang """ localelang = get_locale_lang() if localelang == None: localelang = self.DEFAULT_LANG else: localelang = localelang.split("_")[0] # Check if the language is supported for name, code in LANGUAGES: if code == localelang: return localelang # Set fallback localelang = self.DEFAULT_LANG return localelang