예제 #1
0
    def apply(self):
        (store, itr) = self._localeSelection.get_selected()

        locale = store[itr][1]
        locale = localization.setup_locale(locale,
                                           self.data.lang,
                                           text_mode=False)
        self._set_lang(locale)

        # Skip timezone and keyboard default setting for kickstart installs.
        # The user may have provided these values via kickstart and if not, we
        # need to prompt for them.
        if flags.flags.automatedInstall:
            return

        geoloc_timezone = geoloc.get_timezone()
        loc_timezones = localization.get_locale_timezones(self.data.lang.lang)
        if geoloc_timezone:
            # (the geolocation module makes sure that the returned timezone is
            # either a valid timezone or None)
            self.data.timezone.timezone = geoloc_timezone
        elif loc_timezones and not self.data.timezone.timezone:
            # no data is provided by Geolocation, try to get timezone from the
            # current language
            self.data.timezone.timezone = loc_timezones[0]

        self._set_keyboard_defaults(self.data.lang.lang)
예제 #2
0
파일: welcome.py 프로젝트: Sabayon/anaconda
    def apply(self):
        (store, itr) = self._localeSelection.get_selected()

        locale = store[itr][1]
        localization.setup_locale(locale, self.data.lang)

        # Skip timezone and keyboard default setting for kickstart installs.
        # The user may have provided these values via kickstart and if not, we
        # need to prompt for them.
        if flags.flags.automatedInstall:
            return

        geoloc_timezone = geoloc.get_timezone()
        loc_timezones = localization.get_locale_timezones(self.data.lang.lang)
        if geoloc_timezone:
            # (the geolocation module makes sure that the returned timezone is
            # either a valid timezone or None)
            self.data.timezone.timezone = geoloc_timezone
        elif loc_timezones and not self.data.timezone.timezone:
            # no data is provided by Geolocation, try to get timezone from the
            # current language
            self.data.timezone.timezone = loc_timezones[0]

        # setup Gtk direction (RTL/LTR) now that we have the language
        # configuration applied
        setup_gtk_direction()
        self._set_keyboard_defaults(self.data.lang.lang)
예제 #3
0
    def apply(self):
        selected = self.builder.get_object("languageViewSelection")
        (store, itr) = selected.get_selected()

        lang = store[itr][2]
        self.language.select_translation(lang)
        self.data.lang.lang = lang

        # Skip timezone and keyboard default setting for kickstart installs.
        # The user may have provided these values via kickstart and if not, we
        # need to prompt for them.
        if flags.flags.automatedInstall:
            return

        lang_timezone = None
        # check if the geolocation lookup returned a time zone
        # (the geolocation module makes sure that the returned timezone is
        # either a valid timezone or None)
        geoloc_timezone = geoloc.get_timezone()
        if geoloc_timezone:
            lang_timezone = geoloc_timezone
        # if no data is provided by Geolocation,
        # try to get timezone from the current language
        elif self.language.territory and not self.data.timezone.timezone:
            lang_timezone = timezone.get_preferred_timezone(self.language.territory)

        if lang_timezone:
            self.data.timezone.timezone = lang_timezone

        lang_country = self.language.preferred_locale.territory
        self._set_keyboard_defaults(store[itr][1], lang_country)