def get_os_locale_locale(self): """locale (example: ru_RU.UTF-8)""" locale = clLocale() # get locale from boot calculate param localeVal = self.getValueFromCmdLine("calculate",0) if locale.isLangExists(localeVal): return locale.getFieldByLang('locale',localeVal) else: localeVal = self.getValueFromConfig('/etc/env.d/02locale','LANG') if locale.isValueInFieldExists('locale',localeVal): return localeVal if os.environ.has_key("LANG") and os.environ["LANG"] != "C": return os.environ["LANG"] return locale.getFieldByLang("locale","default")
def get_os_lang(self): """Supported languages""" return list(sorted(list(set(clLocale().getLangs()) & set(["en_US","de_DE","es_ES","fr_FR","it_IT","pl_PL","pt_BR", "uk_UA","bg_BG","ru_RU","ro_RO","pt_PT"]))))
def get_os_locale_xkb(self): """xkb layouts (example: en,ru)""" locale = clLocale() return locale.getFieldByLang("xkblayout", self.Get('os_locale_lang'))
def get_os_locale_language(self): """language (example: ru)""" locale = clLocale() return locale.getFieldByLang("language",self.Get('os_locale_lang'))
def get_os_locale_lang(self): """lang (example: ru_RU)""" locale = clLocale() return locale.getLangByField("locale",self.Get('os_locale_locale'))