예제 #1
0
def reset_locale(frontend):
    frontend.start_debconf()
    di_locale = frontend.db.get('debian-installer/locale')
    if not di_locale:
        # TODO cjwatson 2006-07-17: maybe fetch
        # languagechooser/language-name and set a language based on
        # that?
        di_locale = 'en_US.UTF-8'
    if 'LANG' not in os.environ or di_locale != os.environ['LANG']:
        os.environ['LANG'] = di_locale
        os.environ['LANGUAGE'] = di_locale
        try:
            locale.setlocale(locale.LC_ALL, '')
        except locale.Error as e:
            print('locale.setlocale failed: %s (LANG=%s)' % (e, di_locale),
                  file=sys.stderr)
        im_switch.start_im()
    return di_locale
예제 #2
0
def reset_locale(frontend):
    frontend.start_debconf()
    di_locale = frontend.db.get('debian-installer/locale')
    if not di_locale:
        # TODO cjwatson 2006-07-17: maybe fetch
        # languagechooser/language-name and set a language based on
        # that?
        di_locale = 'en_US.UTF-8'
    if 'LANG' not in os.environ or di_locale != os.environ['LANG']:
        os.environ['LANG'] = di_locale
        os.environ['LANGUAGE'] = di_locale
        try:
            locale.setlocale(locale.LC_ALL, '')
        except locale.Error as e:
            print('locale.setlocale failed: %s (LANG=%s)' % (e, di_locale),
                  file=sys.stderr)
        im_switch.start_im()
    return di_locale
예제 #3
0
def reset_locale(frontend, just_country=False):
    frontend.start_debconf()
    di_locale = frontend.db.get('debian-installer/locale')
    if not di_locale:
        # TODO cjwatson 2006-07-17: maybe fetch
        # languagechooser/language-name and set a language based on
        # that?
        di_locale = 'en_US.UTF-8'
    if 'LANG' not in os.environ or di_locale != os.environ['LANG']:
        os.environ['LANG'] = di_locale
        os.environ['LANGUAGE'] = di_locale
        try:
            locale.setlocale(locale.LC_ALL, '')
        except locale.Error, e:
            print >>sys.stderr, 'locale.setlocale failed: %s (LANG=%s)' % \
                                (e, di_locale)
        if not just_country:
            misc.execute_root('fontconfig-voodoo',
                                '--auto', '--force', '--quiet')
        im_switch.start_im()
예제 #4
0
def reset_locale(frontend, just_country=False):
    frontend.start_debconf()
    di_locale = frontend.db.get('debian-installer/locale')
    if not di_locale:
        # TODO cjwatson 2006-07-17: maybe fetch
        # languagechooser/language-name and set a language based on
        # that?
        di_locale = 'en_US.UTF-8'
    if 'LANG' not in os.environ or di_locale != os.environ['LANG']:
        os.environ['LANG'] = di_locale
        os.environ['LANGUAGE'] = di_locale
        try:
            locale.setlocale(locale.LC_ALL, '')
        except locale.Error, e:
            print >>sys.stderr, 'locale.setlocale failed: %s (LANG=%s)' % \
                                (e, di_locale)
        if not just_country:
            misc.execute_root('fontconfig-voodoo', '--auto', '--force',
                              '--quiet')
        im_switch.start_im()