Пример #1
0
    def _load_saved_settings(self):
        locale_setting = strip_encoding_from_locale(get_locale())
        locale_setting = get_setting('Locale')
        lang_code, region_code = Locales.get_codes_from_locale_code(
            locale_setting)

        lang = Locales.lang_code_to_lang(lang_code)
        region = Locales.region_code_to_region(region_code)

        selected_index = self._language_combo.get_items().index(lang)
        self._language_combo.set_selected_item_index(selected_index)

        self._on_language_changed(self._language_combo)

        selected_index = self._region_combo.get_items().index(region)
        self._region_combo.set_selected_item_index(selected_index)
Пример #2
0
    def apply_changes(self, button):
        language = self._language_combo.get_selected_item_text()
        region = self._region_combo.get_selected_item_text()

        locale_code = Locales.get_locale_code_from_langs(language, region)
        set_locale(locale_code)
        set_setting('Locale', locale_code)
        common.need_reboot = True

        self.win.go_to_home()