Update Qlocale data up to CLDR 2.0.1
Change-Id: I4279fac57436d7009a6d61dab5936b72fd39fc14 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
fe8962d3a5
commit
4a115ab4ae
@ -315,6 +315,24 @@ public:
|
||||
Ojibwa = 234,
|
||||
Pali = 235,
|
||||
Walloon = 236,
|
||||
Aghem = 237,
|
||||
Basaa = 238,
|
||||
Zarma = 239,
|
||||
Duala = 240,
|
||||
JolaFonyi = 241,
|
||||
Ewondo = 242,
|
||||
Bafia = 243,
|
||||
MakhuwaMeetto = 244,
|
||||
Mundang = 245,
|
||||
Kwasio = 246,
|
||||
Nuer = 247,
|
||||
Sakha = 248,
|
||||
Sangu = 249,
|
||||
CongoSwahili = 250,
|
||||
Tasawaq = 251,
|
||||
Vai = 252,
|
||||
Walser = 253,
|
||||
Yangben = 254,
|
||||
Norwegian = NorwegianBokmal,
|
||||
Moldavian = Romanian,
|
||||
SerboCroatian = Serbian,
|
||||
@ -326,7 +344,7 @@ public:
|
||||
Cambodian = Khmer,
|
||||
Kurundi = Rundi,
|
||||
RhaetoRomance = Romansh,
|
||||
LastLanguage = Walloon
|
||||
LastLanguage = Yangben
|
||||
};
|
||||
|
||||
enum Script {
|
||||
|
@ -92,7 +92,7 @@
|
||||
\note For the current keyboard input locale take a look at
|
||||
QInputMethod::locale().
|
||||
|
||||
QLocale's data is based on Common Locale Data Repository v1.9.1.
|
||||
QLocale's data is based on Common Locale Data Repository v2.0.1.
|
||||
|
||||
The double-to-string and string-to-double conversion functions are
|
||||
covered by the following licenses:
|
||||
@ -375,6 +375,24 @@
|
||||
\value CentralMoroccoTamazight
|
||||
\value KoyraboroSenni
|
||||
\value Shambala
|
||||
\value Aghem
|
||||
\value Basaa
|
||||
\value Zarma
|
||||
\value Duala
|
||||
\value JolaFonyi
|
||||
\value Ewondo
|
||||
\value Bafia
|
||||
\value MakhuwaMeetto
|
||||
\value Mundang
|
||||
\value Kwasio
|
||||
\value Nuer
|
||||
\value Sakha
|
||||
\value Sangu
|
||||
\value CongoSwahili
|
||||
\value Tasawaq
|
||||
\value Vai
|
||||
\value Walser
|
||||
\value Yangben
|
||||
\omitvalue LastLanguage
|
||||
|
||||
\sa language(), languageToString()
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -372,8 +372,7 @@ void tst_QLocale::ctor()
|
||||
TEST_CTOR("zh_Hans_MO", Chinese, SimplifiedHanScript, Macau)
|
||||
TEST_CTOR("zh_Hant_MO", Chinese, TraditionalHanScript, Macau)
|
||||
TEST_CTOR("az_Latn_AZ", Azerbaijani, LatinScript, Azerbaijan)
|
||||
TEST_CTOR("ha_Arab_NG", Hausa, ArabicScript, Nigeria)
|
||||
TEST_CTOR("ha_Latn_NG", Hausa, LatinScript, Nigeria)
|
||||
TEST_CTOR("ha_NG", Hausa, LatinScript, Nigeria)
|
||||
|
||||
TEST_CTOR("ru", Russian, CyrillicScript, RussianFederation)
|
||||
TEST_CTOR("ru_Cyrl", Russian, CyrillicScript, RussianFederation)
|
||||
@ -1642,7 +1641,7 @@ void tst_QLocale::monthName()
|
||||
|
||||
QLocale ru("ru_RU");
|
||||
QCOMPARE(ru.monthName(1, QLocale::LongFormat), QString::fromUtf8("\321\217\320\275\320\262\320\260\321\200\321\217"));
|
||||
QCOMPARE(ru.monthName(1, QLocale::ShortFormat), QString::fromUtf8("\321\217\320\275\320\262\56"));
|
||||
QCOMPARE(ru.monthName(1, QLocale::ShortFormat), QString::fromUtf8("\321\217\320\275\320\262"));
|
||||
QCOMPARE(ru.monthName(1, QLocale::NarrowFormat), QString::fromUtf8("\320\257"));
|
||||
|
||||
// check that our CLDR scripts handle surrogate pairs correctly
|
||||
@ -1673,7 +1672,7 @@ void tst_QLocale::standaloneMonthName()
|
||||
|
||||
QLocale ru("ru_RU");
|
||||
QCOMPARE(ru.standaloneMonthName(1, QLocale::LongFormat), QString::fromUtf8("\320\257\320\275\320\262\320\260\321\200\321\214"));
|
||||
QCOMPARE(ru.standaloneMonthName(1, QLocale::ShortFormat), QString::fromUtf8("\321\217\320\275\320\262\56"));
|
||||
QCOMPARE(ru.standaloneMonthName(1, QLocale::ShortFormat), QString::fromUtf8("\320\257\320\275\320\262\56"));
|
||||
QCOMPARE(ru.standaloneMonthName(1, QLocale::NarrowFormat), QString::fromUtf8("\320\257"));
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,25 @@ language_list = {
|
||||
233 : [ "Ndonga", "ng" ],
|
||||
234 : [ "Ojibwa", "oj" ], # macrolanguage
|
||||
235 : [ "Pali", "pi" ], # macrolanguage
|
||||
236 : [ "Walloon", "wa" ]
|
||||
236 : [ "Walloon", "wa" ],
|
||||
237 : [ "Aghem", "agq" ],
|
||||
238 : [ "Basaa", "bas" ],
|
||||
239 : [ "Zarma", "dje" ],
|
||||
240 : [ "Duala", "dua" ],
|
||||
241 : [ "JolaFonyi", "dyo" ],
|
||||
242 : [ "Ewondo", "ewo" ],
|
||||
243 : [ "Bafia", "ksf" ],
|
||||
244 : [ "MakhuwaMeetto", "mgh" ],
|
||||
245 : [ "Mundang", "mua" ],
|
||||
246 : [ "Kwasio", "nmg" ],
|
||||
247 : [ "Nuer", "nus" ],
|
||||
248 : [ "Sakha", "sah" ],
|
||||
249 : [ "Sangu", "sbp" ],
|
||||
250 : [ "Congo Swahili", "swc" ],
|
||||
251 : [ "Tasawaq", "twq" ],
|
||||
252 : [ "Vai", "vai" ],
|
||||
253 : [ "Walser", "wae" ],
|
||||
254 : [ "Yangben", "yav" ]
|
||||
}
|
||||
|
||||
country_list = {
|
||||
|
@ -178,7 +178,11 @@ def _findEntryInFile(file, path, draft=None, attribute=None):
|
||||
if elt.attributes.has_key(attribute):
|
||||
return (elt.attributes[attribute].nodeValue, None)
|
||||
return (None, None)
|
||||
return (elt.firstChild.nodeValue, None)
|
||||
try:
|
||||
return (elt.firstChild.nodeValue, None)
|
||||
except:
|
||||
pass
|
||||
return (None, None)
|
||||
|
||||
def findAlias(file):
|
||||
doc = False
|
||||
@ -195,6 +199,36 @@ def findAlias(file):
|
||||
return False
|
||||
return alias_elt.attributes['source'].nodeValue
|
||||
|
||||
parent_locales = {}
|
||||
def _fixedLookupChain(dirname, name):
|
||||
# see http://www.unicode.org/reports/tr35/#Parent_Locales
|
||||
if not parent_locales:
|
||||
for ns in findTagsInFile(dirname + "/../supplemental/supplementalData.xml", "parentLocales"):
|
||||
tmp = {}
|
||||
parent_locale = ""
|
||||
for data in ns[1:][0]: # ns looks like this: [u'parentLocale', [(u'parent', u'root'), (u'locales', u'az_Cyrl bs_Cyrl en_Dsrt ..')]]
|
||||
tmp[data[0]] = data[1]
|
||||
if data[0] == u"parent":
|
||||
parent_locale = data[1]
|
||||
parent_locales[parent_locale] = tmp[u"locales"].split(" ")
|
||||
|
||||
items = name.split("_")
|
||||
# split locale name into items and iterate through them from back to front
|
||||
# example: az_Latn_AZ => [az_Latn_AZ, az_Latn, az]
|
||||
items = list(reversed(map(lambda x: "_".join(items[:x+1]), range(len(items)))))
|
||||
|
||||
for i in range(len(items)):
|
||||
item = items[i]
|
||||
for parent_locale in parent_locales.keys():
|
||||
for locale in parent_locales[parent_locale]:
|
||||
if item == locale:
|
||||
if parent_locale == u"root":
|
||||
items = items[:i+1]
|
||||
else:
|
||||
items = items[:i+1] + parent_locale.split() + items[i+1:]
|
||||
return items
|
||||
return items
|
||||
|
||||
def _findEntry(base, path, draft=None, attribute=None):
|
||||
file = base
|
||||
if base.endswith(".xml"):
|
||||
@ -203,10 +237,8 @@ def _findEntry(base, path, draft=None, attribute=None):
|
||||
else:
|
||||
file = base + ".xml"
|
||||
(dirname, filename) = os.path.split(base)
|
||||
items = filename.split("_")
|
||||
# split locale name into items and iterate through them from back to front
|
||||
# example: az_Latn_AZ => [az_Latn_AZ, az_Latn, az]
|
||||
items = reversed(map(lambda x: "_".join(items[:x+1]), range(len(items))))
|
||||
|
||||
items = _fixedLookupChain(dirname, filename)
|
||||
for item in items:
|
||||
file = dirname + "/" + item + ".xml"
|
||||
if os.path.isfile(file):
|
||||
|
Loading…
x
Reference in New Issue
Block a user