Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/locale.py

    r60 r391  
    1212"""
    1313
    14 import sys, encodings, encodings.aliases
     14import sys
     15import encodings
     16import encodings.aliases
     17import re
     18import operator
    1519import functools
     20
     21try:
     22    _unicode = unicode
     23except NameError:
     24    # If Python is built without Unicode support, the unicode type
     25    # will not exist. Fake one.
     26    class _unicode(object):
     27        pass
    1628
    1729# Try importing the _locale module.
     
    111123# Iterate over grouping intervals
    112124def _grouping_intervals(grouping):
     125    last_interval = None
    113126    for interval in grouping:
    114127        # if grouping is -1, we are done
     
    117130        # 0: re-use last group ad infinitum
    118131        if interval == 0:
     132            if last_interval is None:
     133                raise ValueError("invalid grouping")
    119134            while True:
    120135                yield last_interval
     
    129144    if not grouping:
    130145        return (s, 0)
    131     result = ""
    132     seps = 0
    133146    if s[-1] == ' ':
    134147        stripped = s.rstrip()
     
    167180    return s[lpos:rpos+1]
    168181
     182_percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
     183                         r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
     184
    169185def format(percent, value, grouping=False, monetary=False, *additional):
    170186    """Returns the locale-aware substitution of a %? specifier
     
    174190    '*' modifiers."""
    175191    # this is only for one-percent-specifier strings and this should be checked
    176     if percent[0] != '%':
    177         raise ValueError("format() must be given exactly one %char "
    178                          "format specifier")
     192    match = _percent_re.match(percent)
     193    if not match or len(match.group())!= len(percent):
     194        raise ValueError(("format() must be given exactly one %%char "
     195                         "format specifier, %s not valid") % repr(percent))
     196    return _format(percent, value, grouping, monetary, *additional)
     197
     198def _format(percent, value, grouping=False, monetary=False, *additional):
    179199    if additional:
    180200        formatted = percent % ((value,) + additional)
     
    200220    return formatted
    201221
    202 import re, operator
    203 _percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
    204                          r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
    205 
    206222def format_string(f, val, grouping=False):
    207223    """Formats a string in the same way that the % formatting would use,
     
    211227    new_f = _percent_re.sub('%s', f)
    212228
    213     if isinstance(val, tuple):
    214         new_val = list(val)
     229    if operator.isMappingType(val):
     230        new_val = []
     231        for perc in percents:
     232            if perc.group()[-1]=='%':
     233                new_val.append('%')
     234            else:
     235                new_val.append(format(perc.group(), val, grouping))
     236    else:
     237        if not isinstance(val, tuple):
     238            val = (val,)
     239        new_val = []
    215240        i = 0
    216241        for perc in percents:
    217             starcount = perc.group('modifiers').count('*')
    218             new_val[i] = format(perc.group(), new_val[i], grouping, False, *new_val[i+1:i+1+starcount])
    219             del new_val[i+1:i+1+starcount]
    220             i += (1 + starcount)
    221         val = tuple(new_val)
    222     elif operator.isMappingType(val):
    223         for perc in percents:
    224             key = perc.group("key")
    225             val[key] = format(perc.group(), val[key], grouping)
    226     else:
    227         # val is a single value
    228         val = format(percents[0].group(), val, grouping)
     242            if perc.group()[-1]=='%':
     243                new_val.append('%')
     244            else:
     245                starcount = perc.group('modifiers').count('*')
     246                new_val.append(_format(perc.group(),
     247                                      val[i],
     248                                      grouping,
     249                                      False,
     250                                      *val[i+1:i+1+starcount]))
     251                i += (1 + starcount)
     252    val = tuple(new_val)
    229253
    230254    return new_f % val
     
    314338_setlocale = setlocale
    315339
     340# Avoid relying on the locale-dependent .lower() method
     341# (see issue #1813).
     342_ascii_lower_map = ''.join(
     343    chr(x + 32 if x >= ord('A') and x <= ord('Z') else x)
     344    for x in range(256)
     345)
     346
    316347def normalize(localename):
    317348
     
    331362    """
    332363    # Normalize the locale name and extract the encoding
    333     fullname = localename.lower()
     364    if isinstance(localename, _unicode):
     365        localename = localename.encode('ascii')
     366    fullname = localename.translate(_ascii_lower_map)
    334367    if ':' in fullname:
    335368        # ':' is sometimes used as encoding delimiter.
     
    342375        encoding = ''
    343376
    344     if sys.platform[:3] == "os2":
     377    if sys.platform.startswith("os2"):
    345378        import _locale
    346379        langname, encoding = _locale._getdefaultlocale()
     
    505538
    506539    """ Set the locale for the given category.  The locale can be
    507         a string, a locale tuple (language code, encoding), or None.
    508 
    509         Locale tuples are converted to strings the locale aliasing
     540        a string, an iterable of two strings (language code and encoding),
     541        or None.
     542
     543        Iterables are converted to strings using the locale aliasing
    510544        engine.  Locale strings are passed directly to the C lib.
    511545
     
    528562    _setlocale(category, _build_localename(getdefaultlocale()))
    529563
    530 if sys.platform in ('win32', 'darwin', 'mac', 'os2knix'):
     564if sys.platform.startswith("win") or sys.platform.startswith("os2"):
    531565    # On Win32, this will return the ANSI code page
    532     # On the Mac, it should return the system encoding;
    533     # it might return "ascii" instead
    534566    def getpreferredencoding(do_setlocale = True):
    535567        """Return the charset that the user is likely using."""
     
    597629    'iso8859_14':                   'ISO8859-14',
    598630    'iso8859_15':                   'ISO8859-15',
     631    'iso8859_16':                   'ISO8859-16',
    599632    'iso8859_2':                    'ISO8859-2',
    600633    'iso8859_3':                    'ISO8859-3',
     
    610643    'euc_jp':                       'eucJP',
    611644    'euc_kr':                       'eucKR',
    612     'utf_8':                        'UTF8',
     645    'utf_8':                        'UTF-8',
    613646    'koi8_r':                       'KOI8-R',
    614647    'koi8_u':                       'KOI8-U',
     
    685718#    updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
    686719#    updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
     720#
     721# AP 2010-04-12:
     722# Updated alias mapping to most recent locale.alias file
     723# from X.org distribution using makelocalealias.py.
     724#
     725# These are the differences compared to the old mapping (Python 2.6.5
     726# and older):
     727#
     728#    updated 'ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
     729#    updated 'ru_ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
     730#    updated 'serbocroatian' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
     731#    updated 'sh' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
     732#    updated 'sh_yu' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
     733#    updated 'sr' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
     734#    updated 'sr@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
     735#    updated 'sr@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
     736#    updated 'sr_cs.utf8@latn' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8@latin'
     737#    updated 'sr_cs@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
     738#    updated 'sr_yu' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8@latin'
     739#    updated 'sr_yu.utf8@cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8'
     740#    updated 'sr_yu@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
     741#
    687742
    688743locale_alias = {
     
    736791    'arabic':                               'ar_AA.ISO8859-6',
    737792    'arabic.iso88596':                      'ar_AA.ISO8859-6',
     793    'as':                                   'as_IN.UTF-8',
    738794    'az':                                   'az_AZ.ISO8859-9E',
    739795    'az_az':                                'az_AZ.ISO8859-9E',
    740796    'az_az.iso88599e':                      'az_AZ.ISO8859-9E',
    741797    'be':                                   'be_BY.CP1251',
     798    'be@latin':                             'be_BY.UTF-8@latin',
    742799    'be_by':                                'be_BY.CP1251',
    743800    'be_by.cp1251':                         'be_BY.CP1251',
    744801    'be_by.microsoftcp1251':                'be_BY.CP1251',
     802    'be_by.utf8@latin':                     'be_BY.UTF-8@latin',
     803    'be_by@latin':                          'be_BY.UTF-8@latin',
    745804    'bg':                                   'bg_BG.CP1251',
    746805    'bg_bg':                                'bg_BG.CP1251',
     
    772831    'c_c.c':                                'C',
    773832    'ca':                                   'ca_ES.ISO8859-1',
     833    'ca_ad':                                'ca_AD.ISO8859-1',
     834    'ca_ad.iso88591':                       'ca_AD.ISO8859-1',
     835    'ca_ad.iso885915':                      'ca_AD.ISO8859-15',
     836    'ca_ad.iso885915@euro':                 'ca_AD.ISO8859-15',
     837    'ca_ad.utf8@euro':                      'ca_AD.UTF-8',
     838    'ca_ad@euro':                           'ca_AD.ISO8859-15',
    774839    'ca_es':                                'ca_ES.ISO8859-1',
    775840    'ca_es.iso88591':                       'ca_ES.ISO8859-1',
     
    778843    'ca_es.utf8@euro':                      'ca_ES.UTF-8',
    779844    'ca_es@euro':                           'ca_ES.ISO8859-15',
     845    'ca_fr':                                'ca_FR.ISO8859-1',
     846    'ca_fr.iso88591':                       'ca_FR.ISO8859-1',
     847    'ca_fr.iso885915':                      'ca_FR.ISO8859-15',
     848    'ca_fr.iso885915@euro':                 'ca_FR.ISO8859-15',
     849    'ca_fr.utf8@euro':                      'ca_FR.UTF-8',
     850    'ca_fr@euro':                           'ca_FR.ISO8859-15',
     851    'ca_it':                                'ca_IT.ISO8859-1',
     852    'ca_it.iso88591':                       'ca_IT.ISO8859-1',
     853    'ca_it.iso885915':                      'ca_IT.ISO8859-15',
     854    'ca_it.iso885915@euro':                 'ca_IT.ISO8859-15',
     855    'ca_it.utf8@euro':                      'ca_IT.UTF-8',
     856    'ca_it@euro':                           'ca_IT.ISO8859-15',
    780857    'catalan':                              'ca_ES.ISO8859-1',
    781858    'cextend':                              'en_US.ISO8859-1',
     
    799876    'czech':                                'cs_CZ.ISO8859-2',
    800877    'da':                                   'da_DK.ISO8859-1',
     878    'da.iso885915':                         'da_DK.ISO8859-15',
    801879    'da_dk':                                'da_DK.ISO8859-1',
    802880    'da_dk.88591':                          'da_DK.ISO8859-1',
     
    809887    'dansk':                                'da_DK.ISO8859-1',
    810888    'de':                                   'de_DE.ISO8859-1',
     889    'de.iso885915':                         'de_DE.ISO8859-15',
    811890    'de_at':                                'de_AT.ISO8859-1',
    812891    'de_at.iso88591':                       'de_AT.ISO8859-1',
     
    9901069    'fa_ir.isiri3342':                      'fa_IR.ISIRI-3342',
    9911070    'fi':                                   'fi_FI.ISO8859-15',
     1071    'fi.iso885915':                         'fi_FI.ISO8859-15',
    9921072    'fi_fi':                                'fi_FI.ISO8859-15',
    9931073    'fi_fi.88591':                          'fi_FI.ISO8859-1',
     
    10051085    'fo_fo@euro':                           'fo_FO.ISO8859-15',
    10061086    'fr':                                   'fr_FR.ISO8859-1',
     1087    'fr.iso885915':                         'fr_FR.ISO8859-15',
    10071088    'fr_be':                                'fr_BE.ISO8859-1',
    10081089    'fr_be.88591':                          'fr_BE.ISO8859-1',
     
    10911172    'hi_in':                                'hi_IN.ISCII-DEV',
    10921173    'hi_in.isciidev':                       'hi_IN.ISCII-DEV',
     1174    'hne':                                  'hne_IN.UTF-8',
    10931175    'hr':                                   'hr_HR.ISO8859-2',
    10941176    'hr_hr':                                'hr_HR.ISO8859-2',
     
    11171199    'iso_8859_15':                          'en_US.ISO8859-15',
    11181200    'it':                                   'it_IT.ISO8859-1',
     1201    'it.iso885915':                         'it_IT.ISO8859-15',
    11191202    'it_ch':                                'it_CH.ISO8859-1',
    11201203    'it_ch.iso88591':                       'it_CH.ISO8859-1',
     
    11481231    'ja_jp.jis7':                           'ja_JP.JIS7',
    11491232    'ja_jp.mscode':                         'ja_JP.SJIS',
     1233    'ja_jp.pck':                            'ja_JP.SJIS',
    11501234    'ja_jp.sjis':                           'ja_JP.SJIS',
    11511235    'ja_jp.ujis':                           'ja_JP.eucJP',
     
    11671251    'kl_gl@euro':                           'kl_GL.ISO8859-15',
    11681252    'km_kh':                                'km_KH.UTF-8',
     1253    'kn':                                   'kn_IN.UTF-8',
    11691254    'kn_in':                                'kn_IN.UTF-8',
    11701255    'ko':                                   'ko_KR.eucKR',
     
    11741259    'korean':                               'ko_KR.eucKR',
    11751260    'korean.euc':                           'ko_KR.eucKR',
     1261    'ks':                                   'ks_IN.UTF-8',
     1262    'ks_in@devanagari':                     'ks_IN@devanagari.UTF-8',
    11761263    'kw':                                   'kw_GB.ISO8859-1',
    11771264    'kw_gb':                                'kw_GB.ISO8859-1',
     
    11961283    'lv_lv.iso885913':                      'lv_LV.ISO8859-13',
    11971284    'lv_lv.iso88594':                       'lv_LV.ISO8859-4',
     1285    'mai':                                  'mai_IN.UTF-8',
    11981286    'mi':                                   'mi_NZ.ISO8859-1',
    11991287    'mi_nz':                                'mi_NZ.ISO8859-1',
     
    12041292    'mk_mk.iso88595':                       'mk_MK.ISO8859-5',
    12051293    'mk_mk.microsoftcp1251':                'mk_MK.CP1251',
     1294    'ml':                                   'ml_IN.UTF-8',
     1295    'mr':                                   'mr_IN.UTF-8',
    12061296    'mr_in':                                'mr_IN.UTF-8',
    12071297    'ms':                                   'ms_MY.ISO8859-1',
     
    12181308    'nb_no@euro':                           'nb_NO.ISO8859-15',
    12191309    'nl':                                   'nl_NL.ISO8859-1',
     1310    'nl.iso885915':                         'nl_NL.ISO8859-15',
    12201311    'nl_be':                                'nl_BE.ISO8859-1',
    12211312    'nl_be.88591':                          'nl_BE.ISO8859-1',
     
    12441335    'no_no.iso88591':                       'no_NO.ISO8859-1',
    12451336    'no_no.iso885915':                      'no_NO.ISO8859-15',
     1337    'no_no.iso88591@bokmal':                'no_NO.ISO8859-1',
     1338    'no_no.iso88591@nynorsk':               'no_NO.ISO8859-1',
    12461339    'no_no@euro':                           'no_NO.ISO8859-15',
    12471340    'norwegian':                            'no_NO.ISO8859-1',
     
    12651358    'oc_fr.iso885915':                      'oc_FR.ISO8859-15',
    12661359    'oc_fr@euro':                           'oc_FR.ISO8859-15',
     1360    'or':                                   'or_IN.UTF-8',
     1361    'pa':                                   'pa_IN.UTF-8',
    12671362    'pa_in':                                'pa_IN.UTF-8',
    12681363    'pd':                                   'pd_US.ISO8859-1',
     
    12921387    'pp_an.iso88591':                       'pp_AN.ISO8859-1',
    12931388    'pt':                                   'pt_PT.ISO8859-1',
     1389    'pt.iso885915':                         'pt_PT.ISO8859-15',
    12941390    'pt_br':                                'pt_BR.ISO8859-1',
    12951391    'pt_br.88591':                          'pt_BR.ISO8859-1',
     
    13081404    'ro_ro.iso88592':                       'ro_RO.ISO8859-2',
    13091405    'romanian':                             'ro_RO.ISO8859-2',
    1310     'ru':                                   'ru_RU.ISO8859-5',
    1311     'ru_ru':                                'ru_RU.ISO8859-5',
     1406    'ru':                                   'ru_RU.UTF-8',
     1407    'ru.koi8r':                             'ru_RU.KOI8-R',
     1408    'ru_ru':                                'ru_RU.UTF-8',
    13121409    'ru_ru.cp1251':                         'ru_RU.CP1251',
    13131410    'ru_ru.iso88595':                       'ru_RU.ISO8859-5',
     
    13231420    'rw_rw':                                'rw_RW.ISO8859-1',
    13241421    'rw_rw.iso88591':                       'rw_RW.ISO8859-1',
     1422    'sd':                                   'sd_IN@devanagari.UTF-8',
    13251423    'se_no':                                'se_NO.UTF-8',
    1326     'serbocroatian':                        'sr_CS.ISO8859-2',
    1327     'sh':                                   'sr_CS.ISO8859-2',
     1424    'serbocroatian':                        'sr_RS.UTF-8@latin',
     1425    'sh':                                   'sr_RS.UTF-8@latin',
     1426    'sh_ba.iso88592@bosnia':                'sr_CS.ISO8859-2',
    13281427    'sh_hr':                                'sh_HR.ISO8859-2',
    13291428    'sh_hr.iso88592':                       'hr_HR.ISO8859-2',
    13301429    'sh_sp':                                'sr_CS.ISO8859-2',
    1331     'sh_yu':                                'sr_CS.ISO8859-2',
     1430    'sh_yu':                                'sr_RS.UTF-8@latin',
    13321431    'si':                                   'si_LK.UTF-8',
    13331432    'si_lk':                                'si_LK.UTF-8',
     
    13521451    'sq_al':                                'sq_AL.ISO8859-2',
    13531452    'sq_al.iso88592':                       'sq_AL.ISO8859-2',
    1354     'sr':                                   'sr_CS.ISO8859-5',
    1355     'sr@cyrillic':                          'sr_CS.ISO8859-5',
    1356     'sr@latn':                              'sr_CS.ISO8859-2',
     1453    'sr':                                   'sr_RS.UTF-8',
     1454    'sr@cyrillic':                          'sr_RS.UTF-8',
     1455    'sr@latin':                             'sr_RS.UTF-8@latin',
     1456    'sr@latn':                              'sr_RS.UTF-8@latin',
     1457    'sr_cs':                                'sr_RS.UTF-8',
    13571458    'sr_cs.iso88592':                       'sr_CS.ISO8859-2',
    13581459    'sr_cs.iso88592@latn':                  'sr_CS.ISO8859-2',
    13591460    'sr_cs.iso88595':                       'sr_CS.ISO8859-5',
    1360     'sr_cs.utf8@latn':                      'sr_CS.UTF-8',
    1361     'sr_cs@latn':                           'sr_CS.ISO8859-2',
     1461    'sr_cs.utf8@latn':                      'sr_RS.UTF-8@latin',
     1462    'sr_cs@latn':                           'sr_RS.UTF-8@latin',
     1463    'sr_me':                                'sr_ME.UTF-8',
     1464    'sr_rs':                                'sr_RS.UTF-8',
     1465    'sr_rs.utf8@latn':                      'sr_RS.UTF-8@latin',
     1466    'sr_rs@latin':                          'sr_RS.UTF-8@latin',
     1467    'sr_rs@latn':                           'sr_RS.UTF-8@latin',
    13621468    'sr_sp':                                'sr_CS.ISO8859-2',
    1363     'sr_yu':                                'sr_CS.ISO8859-5',
     1469    'sr_yu':                                'sr_RS.UTF-8@latin',
    13641470    'sr_yu.cp1251@cyrillic':                'sr_CS.CP1251',
    13651471    'sr_yu.iso88592':                       'sr_CS.ISO8859-2',
     
    13671473    'sr_yu.iso88595@cyrillic':              'sr_CS.ISO8859-5',
    13681474    'sr_yu.microsoftcp1251@cyrillic':       'sr_CS.CP1251',
    1369     'sr_yu.utf8@cyrillic':                  'sr_CS.UTF-8',
    1370     'sr_yu@cyrillic':                       'sr_CS.ISO8859-5',
     1475    'sr_yu.utf8@cyrillic':                  'sr_RS.UTF-8',
     1476    'sr_yu@cyrillic':                       'sr_RS.UTF-8',
    13711477    'ss':                                   'ss_ZA.ISO8859-1',
    13721478    'ss_za':                                'ss_ZA.ISO8859-1',
     
    13761482    'st_za.iso88591':                       'st_ZA.ISO8859-1',
    13771483    'sv':                                   'sv_SE.ISO8859-1',
     1484    'sv.iso885915':                         'sv_SE.ISO8859-15',
    13781485    'sv_fi':                                'sv_FI.ISO8859-1',
    13791486    'sv_fi.iso88591':                       'sv_FI.ISO8859-1',
     
    13931500    'ta_in.tscii':                          'ta_IN.TSCII-0',
    13941501    'ta_in.tscii0':                         'ta_IN.TSCII-0',
     1502    'te':                                   'te_IN.UTF-8',
    13951503    'tg':                                   'tg_TJ.KOI8-C',
    13961504    'tg_tj':                                'tg_TJ.KOI8-C',
     
    14681576    'zh_hk':                                'zh_HK.big5hkscs',
    14691577    'zh_hk.big5':                           'zh_HK.big5',
     1578    'zh_hk.big5hk':                         'zh_HK.big5hkscs',
    14701579    'zh_hk.big5hkscs':                      'zh_HK.big5hkscs',
    14711580    'zh_tw':                                'zh_TW.big5',
     
    14831592# This list has been updated from
    14841593# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
    1485 # to include every locale up to Windows XP.
     1594# to include every locale up to Windows Vista.
    14861595#
    14871596# NOTE: this mapping is incomplete.  If your language is missing, please
    1488 # submit a bug report to Python bug manager, which you can find via:
    1489 #     http://www.python.org/dev/
     1597# submit a bug report to the Python bug tracker at http://bugs.python.org/
    14901598# Make sure you include the missing language identifier and the suggested
    14911599# locale code.
     
    14951603    0x0436: "af_ZA", # Afrikaans
    14961604    0x041c: "sq_AL", # Albanian
     1605    0x0484: "gsw_FR",# Alsatian - France
     1606    0x045e: "am_ET", # Amharic - Ethiopia
    14971607    0x0401: "ar_SA", # Arabic - Saudi Arabia
    14981608    0x0801: "ar_IQ", # Arabic - Iraq
     
    15121622    0x4001: "ar_QA", # Arabic - Qatar
    15131623    0x042b: "hy_AM", # Armenian
    1514     0x042c: "az_AZ", # Azeri Latin
     1624    0x044d: "as_IN", # Assamese - India
     1625    0x042c: "az_AZ", # Azeri - Latin
    15151626    0x082c: "az_AZ", # Azeri - Cyrillic
    1516     0x042d: "eu_ES", # Basque
     1627    0x046d: "ba_RU", # Bashkir
     1628    0x042d: "eu_ES", # Basque - Russia
    15171629    0x0423: "be_BY", # Belarusian
    15181630    0x0445: "bn_IN", # Begali
    1519     0x201a: "bs_BA", # Bosnian
    1520     0x141a: "bs_BA", # Bosnian - Cyrillic
     1631    0x201a: "bs_BA", # Bosnian - Cyrillic
     1632    0x141a: "bs_BA", # Bosnian - Latin
    15211633    0x047e: "br_FR", # Breton - France
    15221634    0x0402: "bg_BG", # Bulgarian
     1635#    0x0455: "my_MM", # Burmese - Not supported
    15231636    0x0403: "ca_ES", # Catalan
    15241637    0x0004: "zh_CHS",# Chinese - Simplified
     
    15291642    0x1404: "zh_MO", # Chinese - Macao S.A.R.
    15301643    0x7c04: "zh_CHT",# Chinese - Traditional
     1644    0x0483: "co_FR", # Corsican - France
    15311645    0x041a: "hr_HR", # Croatian
    15321646    0x101a: "hr_BA", # Croatian - Bosnia
     
    15491663    0x2c09: "en_TT", # English - Trinidad
    15501664    0x3009: "en_ZW", # English - Zimbabwe
    1551     0x3409: "en_PH", # English - Phillippines
     1665    0x3409: "en_PH", # English - Philippines
     1666    0x4009: "en_IN", # English - India
     1667    0x4409: "en_MY", # English - Malaysia
     1668    0x4809: "en_IN", # English - Singapore
    15521669    0x0425: "et_EE", # Estonian
    15531670    0x0438: "fo_FO", # Faroese
     
    15691686    0x1407: "de_LI", # German - Liechtenstein
    15701687    0x0408: "el_GR", # Greek
     1688    0x046f: "kl_GL", # Greenlandic - Greenland
    15711689    0x0447: "gu_IN", # Gujarati
     1690    0x0468: "ha_NG", # Hausa - Latin
    15721691    0x040d: "he_IL", # Hebrew
    15731692    0x0439: "hi_IN", # Hindi
     
    15751694    0x040f: "is_IS", # Icelandic
    15761695    0x0421: "id_ID", # Indonesian
    1577     0x045d: "iu_CA", # Inuktitut
     1696    0x045d: "iu_CA", # Inuktitut - Syllabics
    15781697    0x085d: "iu_CA", # Inuktitut - Latin
    15791698    0x083c: "ga_IE", # Irish - Ireland
    1580     0x0434: "xh_ZA", # Xhosa - South Africa
    1581     0x0435: "zu_ZA", # Zulu
    15821699    0x0410: "it_IT", # Italian - Italy
    15831700    0x0810: "it_CH", # Italian - Switzerland
     
    15851702    0x044b: "kn_IN", # Kannada - India
    15861703    0x043f: "kk_KZ", # Kazakh
     1704    0x0453: "kh_KH", # Khmer - Cambodia
     1705    0x0486: "qut_GT",# K'iche - Guatemala
     1706    0x0487: "rw_RW", # Kinyarwanda - Rwanda
    15871707    0x0457: "kok_IN",# Konkani
    15881708    0x0412: "ko_KR", # Korean
    15891709    0x0440: "ky_KG", # Kyrgyz
     1710    0x0454: "lo_LA", # Lao - Lao PDR
    15901711    0x0426: "lv_LV", # Latvian
    15911712    0x0427: "lt_LT", # Lithuanian
     1713    0x082e: "dsb_DE",# Lower Sorbian - Germany
    15921714    0x046e: "lb_LU", # Luxembourgish
    1593     0x042f: "mk_MK", # FYRO Macedonian
     1715    0x042f: "mk_MK", # FYROM Macedonian
    15941716    0x043e: "ms_MY", # Malay - Malaysia
    1595     0x083e: "ms_BN", # Malay - Brunei
     1717    0x083e: "ms_BN", # Malay - Brunei Darussalam
    15961718    0x044c: "ml_IN", # Malayalam - India
    15971719    0x043a: "mt_MT", # Maltese
     
    16001722    0x044e: "mr_IN", # Marathi
    16011723    0x047c: "moh_CA",# Mohawk - Canada
    1602     0x0450: "mn_MN", # Mongolian
     1724    0x0450: "mn_MN", # Mongolian - Cyrillic
     1725    0x0850: "mn_CN", # Mongolian - PRC
    16031726    0x0461: "ne_NP", # Nepali
    16041727    0x0414: "nb_NO", # Norwegian - Bokmal
     
    16161739    0x0c6b: "quz_PE",# Quechua (Peru)
    16171740    0x0418: "ro_RO", # Romanian - Romania
    1618     0x0417: "rm_CH", # Raeto-Romanese
     1741    0x0417: "rm_CH", # Romansh
    16191742    0x0419: "ru_RU", # Russian
    16201743    0x243b: "smn_FI",# Sami Finland
     
    16321755    0x081a: "sr_SP", # Serbian - Latin
    16331756    0x181a: "sr_BA", # Serbian - Bosnia Latin
     1757    0x045b: "si_LK", # Sinhala - Sri Lanka
    16341758    0x046c: "ns_ZA", # Northern Sotho
    16351759    0x0432: "tn_ZA", # Setswana - Southern Africa
     
    16561780    0x4c0a: "es_NI", # Spanish - Nicaragua
    16571781    0x500a: "es_PR", # Spanish - Puerto Rico
     1782    0x540a: "es_US", # Spanish - United States
     1783#    0x0430: "", # Sutu - Not supported
    16581784    0x0441: "sw_KE", # Swahili
    16591785    0x041d: "sv_SE", # Swedish - Sweden
    16601786    0x081d: "sv_FI", # Swedish - Finland
    16611787    0x045a: "syr_SY",# Syriac
     1788    0x0428: "tg_TJ", # Tajik - Cyrillic
     1789    0x085f: "tmz_DZ",# Tamazight - Latin
    16621790    0x0449: "ta_IN", # Tamil
    16631791    0x0444: "tt_RU", # Tatar
    16641792    0x044a: "te_IN", # Telugu
    16651793    0x041e: "th_TH", # Thai
     1794    0x0851: "bo_BT", # Tibetan - Bhutan
     1795    0x0451: "bo_CN", # Tibetan - PRC
    16661796    0x041f: "tr_TR", # Turkish
     1797    0x0442: "tk_TM", # Turkmen - Cyrillic
     1798    0x0480: "ug_CN", # Uighur - Arabic
    16671799    0x0422: "uk_UA", # Ukrainian
     1800    0x042e: "wen_DE",# Upper Sorbian - Germany
    16681801    0x0420: "ur_PK", # Urdu
    16691802    0x0820: "ur_IN", # Urdu - India
     
    16721805    0x042a: "vi_VN", # Vietnamese
    16731806    0x0452: "cy_GB", # Welsh
     1807    0x0488: "wo_SN", # Wolof - Senegal
     1808    0x0434: "xh_ZA", # Xhosa - South Africa
     1809    0x0485: "sah_RU",# Yakut - Cyrillic
     1810    0x0478: "ii_CN", # Yi - PRC
     1811    0x046a: "yo_NG", # Yoruba - Nigeria
     1812    0x0435: "zu_ZA", # Zulu
    16741813}
    16751814
Note: See TracChangeset for help on using the changeset viewer.