summaryrefslogtreecommitdiffstats
path: root/util/local_database/cldr2qlocalexml.py
Commit message (Collapse)AuthorAgeFilesLines
* Rename util/locale_database/ to include the e that was missingEdward Welbourne2019-05-201-663/+0
| | | | | | | | | It was misnamed local_database, quite missing the point of its name. Change-Id: I73a4fdf24f53daac12304de1f443636d89afacb2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| * Update cldr2qlocalexml.py's claimed CLDR version supportEdward Welbourne2019-05-071-1/+1
| | | | | | | | | | | | | | | | | | It was up to date with v34 (and seems to cope with v35.1) but only clained support for v29. Change-Id: I686cae1977824a4deec4633f19604b91061fe78a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Correct and expand documentation of splitLocale()Edward Welbourne2018-09-101-2/+4
| | | | | | | | | | | | | | | | | | This amends c1141ed729b84f2c413975d37c1a91fb235fb14a; I failed to update the doc-string after some design changes part-way through developing the function. Change-Id: Ifb83107153d1c3b5a9dbd0536a3d6ee1fe32922d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Reduce redundancy in CLDR script output to stderrEdward Welbourne2018-08-271-12/+26
| | | | | | | | | | | | | | | | A few patterns accounted for a substantial majority of the output, so report these in summarised (and somewhat tidly formatted) form. Change-Id: I57f8e41d5e68774fe57b01bb295534aa84a2df15 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Fix handling of default content locale dataEdward Welbourne2018-08-221-36/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We iterate theoretically many sources (albeit there's only really ever one) for this data, so accumulate instead of only keeping the last (and initialize it as the list it always ended up being, not a dictionary, so that this can work). The form of each token is a locale name, so it may be lang_Script just as readily as lang_LAND; so parse (and validate) the tags more faithfully to catch both cases. Abstract that parsing into a function and use it in both places that need it. Change-Id: Ibdbc4eafefab6a5ef70646d9fea150f2cb408d05 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Stipulate which error is expected in try/exceptEdward Welbourne2018-08-221-1/+1
|/ | | | | | | | PEP 8 wisely advises against the use of naked except: (unless re-raising the error). Change-Id: Ia0dfdb48b330d33ad370bdb9f6b205046aa919da Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Update QLocale::Country doc for new territoriesEdward Welbourne2018-08-161-1/+6
| | | | | | | | | Neglected in 44b6757fe50b6bf581864d3da519a3ff60818fa8 Noted the need for this in a relevant script's instructions. Change-Id: If69666f1799acebd434034c80b91056cb8777488 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rework CLDR parser to filter out unsupportable number systemsEdward Welbourne2018-07-161-14/+25
| | | | | | | | | | In the process, also have it only scan number systems once, caching the result, rather than scanning all of them for each locale. This means we only see the new warning messages once, too. Task-number: QTBUG-69324 Change-Id: Ia0695a0ba6159b50748a61e9949ad5bd07e4c4c3 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add a note to the CLDR-munging scripts about updating the attributionEdward Welbourne2018-02-171-0/+3
| | | | | | | Change-Id: I9de320d10ddd8947f3f6cf29636e42f08f814a28 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Add byte-based units to CLDR dataEdward Welbourne2017-06-131-0/+69
| | | | | | | | | | | | Scan CLDR for {,kilo,mega,giga,tera,peta,exa}byte forms and their IEC equivalents, providing SI and IEC defaults when missing (which all of IEC are) in addition to the usual numeric data. Extrapolate from any present data (e.g. French's ko, Mo, Go, To imply Po, Eo and, for IEC, Kio, Mio, etc.), since CLDR only goes up to tera. Propagate this data to QLocale's database ready for use by QLocale::formattedDataSize(). Change-Id: Ie6ee978948c68be9f71ab784a128cbfae3d80ee1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Clean up in CLDR scripts for QLocaleEdward Welbourne2017-06-091-39/+32
| | | | | | | | | | | | | | Use python more fluently; DRY - use functions to avoid repetition; use dict-comprehensions; use os.path.join() in preference to arithmetic with path strings; use elsif to avoid the need for a local variable; set() can take a generator directly, no need to go via a list; don't end lines in semicolon (this is python). Test isdir() once instead of exists() twice on the same name. Just, generally, use python's feature-set. Change-Id: Ib114aa016f70b3be09e968d9cfc069b057f49d41 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Simplify cldr2qlocalexml.integrateWeekData()Edward Welbourne2017-06-091-65/+13
| | | | | | | | | It had a separate variable for each of three lists for each day of the week; and used each list only once. Iterate the days of the week for each lookup, discarding it once used. Change-Id: I32c8bd5bfcbb99f0a8697d374e63112761f18dbb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rework locale serialization and parsing with less repetitionEdward Welbourne2017-06-091-152/+18
| | | | | | | | | | | | | | | | ... because copy-and-paste is worth discouraging. Moved code that writes and digests our Q Local XML form of the data into a common class, localexml.Locale, for use by the scripts that write and read it. Hopefully, it'll be easier to keep what's written and read in sync hereafter. Inlined some trivial functions in the process; and only create a day-number mapping dictionary once, instead of once per use. Also made it easier to see which attributes get which special handling (and documented this); and revised an assertion to be more helpful. Change-Id: I711b6a193a4ad94b5ff714c025f2732cd1a965a7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Give reasons when skipping filesEdward Welbourne2017-06-081-4/+4
| | | | | | Change-Id: I397d17ad252363dd0d7d9b4f53b7d105075da306 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use python more competently in CLDR/qLocaleXML scriptsEdward Welbourne2017-06-081-234/+109
| | | | | | | | | | | | | | | | Make the python2 dependency explicit (sooner or later, python3 shall be the default /bin/env python), make time-zone script executable (it had a shebang). Use triple-quoted strings, or single quotes, to avoid extra backslashes, remove some simply spurious backslashes. Use generators rather than map or filter with lambdas and iterate rather than duplicating code. Clarify some comments. Regenerated headers: this upates the date of generation, cuts back a double-blank-line to single and skips a spurious trailing comma-newline on an array's data. Change-Id: I54439f0dec132865991fe5147d509cea0f9419a0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Document how to use the CLDR-related scriptsEdward Welbourne2017-06-081-0/+13
| | | | | | | | Say where to find the data, how to unpack it and how to run the scripts to update our source tree from it. Change-Id: I5b680090bb5850f29c1e7d61efd1d450856b9949 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update CLDR to v27Konstantin Ritt2015-03-271-34/+34
| | | | | | | | | | | | | + A bunch of fixes in the locale data + New scripts from Unicode 7.0 + New locales - Some locales disappeared (aa_DJ, aa_ER, st_LS, ss_SZ, swc_CD, tn_BW) - Some locales lost their contents (i.e. en_Dsrt_US) [ChangeLog][QtCore] QLocale data updated to CLDR v.27 Change-Id: Iba8c7884f8087e577cbb25a8fc106dd7bd3ebb5d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QLocaleData] Extract defaultContent localesKonstantin Ritt2015-03-271-5/+46
| | | | | | | | | | | | | | This adds some locales missing in the common/main/ directory, namely: bss_CM, cch_NG, dv_MV, gaa_GH, gez_ET, ha_Arab_NG, iu_Cans_CA, kaj_NG, kcg_NG, kpe_LR, ku_Latn_TR, mi_NZ, ms_Arab_MY, mn_Mong_CN, nds_DE, ny_MW, oc_FR, sa_IN, sid_ET, tk_Latn_TM, trv_TW, tt_RU, ug_Arab_CN, wa_BE, wo_Latn_SN See http://www.unicode.org/reports/tr35/tr35-info.html#Default_Content for more info. Change-Id: I6b3082d370a21da64fbd5e72ab6344e1d7a6a3c9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update the internal CLDR tables up to v.24Konstantin Ritt2014-01-131-4/+14
| | | | | | | Change-Id: I9c0b110e36dd80c6a0b7275aa13bc548419aca9c Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use likelySubtags to instantiate a locale id from it's short formKonstantin Ritt2012-11-211-24/+31
| | | | | | | | | ...just like described in http://www.unicode.org/reports/tr35/#Likely_Subtags. This is much more effective than current "guessing" algorithm + makes it possible to instantiate a locale by the script or territory code only. Change-Id: I674f8476e65b01c56960b6e83a1a346df0715274 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [SIC/BIC] QLocale: update enums up to CLRD 1.9.1Konstantin Ritt2012-11-211-4/+3
| | | | | | | | | | This patch adds some missing codes (two-letter ones only), removes an outdated ones, and updates some names. The legacy language codes are handled in QLocalePrivate::codeToLanguage() (fortunately, there are only 4 of such codes). Change-Id: Iff50aecd1c762b6399cd151aebb955f341d366c6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocale: replace hard-coded default country-for-language mapKonstantin Ritt2012-11-191-103/+72
| | | | | | | | | | ...with a generated one in a way similar to what http://www.unicode.org/reports/tr35/#Likely_Subtags suggests. The supplemental/likelySubtags.xml contains all the required data. This changes some default countries to a most-expected ones. Change-Id: I920a5623601d8661a943e78197d3bcc838191483 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Assign correct codes to QLocale::AnyCountry and AnyScriptKonstantin Ritt2012-11-151-9/+5
| | | | | | | as their meaning, in fact, is unknown (or default) country/script. Change-Id: Id75a70d4b33c2092de414f3ac357f6bcb627ba47 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Misc fixes to the QLocale data parser/generatorKonstantin Ritt2012-11-151-3/+3
| | | | | Change-Id: I01589eae4e48bc1f484d54277de8f18262ca8f31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update QLocale data from CLDR v1.8.1 to CLDR v1.9.1Jędrzej Nowacki2012-03-241-2/+22
| | | | | Change-Id: Ic84bbc82b364b92605c1bba64b6ec815bff970cb Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+810
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12