qt5base-lts/util/locale_database
Edward Welbourne be3dfd7a71 Rework cldr2qlocalexml.py's reading of CLDR data
Move the code out to a CldrReader class in cldr.py, expand CldrAccess
with facilities that needs, expand ldml.py to include support for more
features, finally making xpathlite.py redundant. This initial commit
aims, though, to be bug-for-bug compatible with xpathlite in its
reading of the CLDR data.

It turns out we've been using draftier data than we were aware of
(which might not be a bad thing). The xpathlite code appeared to check
for draft attributes, but these only appear on leaf nodes and most
data were fetched by finding a parent and then scanning its children
without the draft check; only am/pm data was actually being excluded
based on draft values.  (We allowed contributed, for am/pm, in
addition to approved, which is all the xpathlite code allows
otherwise.) There are also some less equivocal bugs; I'll deal with
these in later commits.

Simplified number-system data look-ups; the old get_number_in_system()
was taking care of old LDML versions' placement of the number system
attribute; this is no longer needed. (It was also being used for a
currency value to which it was not appropriate, which is now handled
separately; this is one of the bugs mentioned above.) Ditched a
fall-back to nativeZeroDigit, which no longer exists in CLDR.

Change the command-line to take the root of the CLDR data tree, rather
than its common/main/ sub-directory. Support naming the file to which
to write output, as a second command-line argument, instead of always
writing to stdout (which remains the default) and leaving whoever runs
the script to redirect stdout.

Support (internally for now, while adding TODOs to give main() more
command-line options) separating the stderr output into its more and
less interesting parts; for now, continue producing both, but suppress
the least interesting entirely.

Task-number: QTBUG-81344
Change-Id: Ie611b47403a9452b51feaeeaaa0fbc8f7e84dc71
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:18 +01:00
..
testlocales Rename util/locale_database/ to include the e that was missing 2019-05-20 20:42:10 +02:00
cldr2qlocalexml.py Rework cldr2qlocalexml.py's reading of CLDR data 2020-04-02 19:43:18 +01:00
cldr2qtimezone.py Move cldr2qtimezone.py's CLDR-reading to a CldrAccess class 2020-04-02 19:43:13 +01:00
cldr.py Rework cldr2qlocalexml.py's reading of CLDR data 2020-04-02 19:43:18 +01:00
dateconverter.py Rename util/locale_database/ to include the e that was missing 2019-05-20 20:42:10 +02:00
enumdata.py Update CLDR to v36 2019-10-25 11:44:48 +02:00
formattags.txt Rename util/locale_database/ to include the e that was missing 2019-05-20 20:42:10 +02:00
ldml.py Rework cldr2qlocalexml.py's reading of CLDR data 2020-04-02 19:43:18 +01:00
localetools.py Add tools to localetools to facilitate source file recreation 2020-04-02 19:42:45 +01:00
qlocalexml2cpp.py Rework cldr2qlocalexml.py's reading of CLDR data 2020-04-02 19:43:18 +01:00
qlocalexml.py Move some shared code to a localetools module 2020-04-02 19:42:40 +01:00
README Rename util/locale_database/ to include the e that was missing 2019-05-20 20:42:10 +02:00

locale_database is used to generate qlocale data from CLDR.

CLDR is the Common Locale Data Repository, a database for localized
data (like date formats, country names etc).  It is provided by the
Unicode consortium.