summaryrefslogtreecommitdiffstats
path: root/util/local_database
Commit message (Collapse)AuthorAgeFilesLines
* Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* 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>
* Right-align keys in enumdata.py's *_list mappingsEdward Welbourne2018-08-271-769/+769
| | | | | | Change-Id: Ia73745b4ce4da369dd8ad4edbc75f5534591480c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> 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>
* Add some missing language codes to our locale dataEdward Welbourne2018-08-271-3/+8
| | | | | | | | | | | | | | We were missing a few languages CLDR knew about; so add them to the list in enumdata.py (and add trailing commas to lists to make future additions not need to change the prior last line; python is perfectly happy with this). [ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido, Lojban, Sicilian and Souther Kurdish. Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Skip a few unused assignmentsEdward Welbourne2018-08-231-4/+0
| | | | | Change-Id: Ia631627fb2e4e7eacf912a08d168e7b0a5700db7 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>
* Tidy up generation of aliases in locale-related enumsEdward Welbourne2018-08-162-46/+70
| | | | | | | | | Replace lines of formatted output with dictionaries from which that output can be generated efficiently (in sorted order). Tidy up the python code, in the process. Change-Id: Ifb74eb69342646c5dbabc3247b3a8ddef602e934 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Normalise spacing in Language, Country and Script namesEdward Welbourne2018-08-161-764/+764
| | | | | | | | | | The scripts that generate the C++ enum names clean out spaces, so there's no need for enumdata.py to use the squished names; instead, include spaces where they belong and use them in the relevant names where they show up. Change-Id: I7261c87d69e654bc2e89f44d7ebbc06bfb403c58 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for numbered territories in CLDREdward Welbourne2018-08-132-3/+7
| | | | | | | | | | | | | | | | | | The CLDR data contains eight locales with numeric territory codes, 001 for World, 150 for Europe and 419 for Latin America. The last was already known in our enumdata.py, but as "Latin America and The Caribbean", which is not supported by the CLDR, so I've amended it while adding the other two. This gives us support for Esperanto and Yiddish (among others). [ChangeLog][QtCore][QLocale] Added support for World and Europe as (numeric) "country" codes ("territory" in CLDR terms), thereby enabling support for Yiddish and Esperanto, among other locales using such codes. Task-number: QTBUG-57802 Change-Id: Ibb1180fb720743a3a0589527649d10f3c9cd123d 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-133-4/+89
| | | | | | | | | | | | 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-092-85/+57
| | | | | | | | | | | | | | 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>
* Replace three functions with one simpler functionEdward Welbourne2017-06-091-35/+9
| | | | | | | | | | load{Language,Script,Country}Map() were all structurally very similar, so replace them with a single loadMap() that takes a second argument to say *which* map to load. At the same time, use a dict comprehension to simplify constructing the result. Change-Id: Ie43a71156010277200543a8937056efd35251955 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Turn a next-node function into an iterator over nodesEdward Welbourne2017-06-091-32/+21
| | | | | | | | | | | | | | This simplifies a duplicated iteration pattern in the calling code. It also frees the first-node function to raise an Error (which the iterator now catches) if it finds no node, where it used to return False (instead of a node, so other code using it would raise confusing errors from trying to use False as a node, where now it'll get a clear Error about a missing node). There were also no callers passing an empty name, so the test for matching nodes (here moved to its own short function) didn't need to handle that as a special case. Change-Id: Ife6cad8943cf5dc2c6ed68429d4a217cb9bea446 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>
* Reduce code duplication in writing of string data for localesEdward Welbourne2017-06-091-86/+22
| | | | | | | | | | Each StringData object got its own block, of common form, to output its C array; give each object a name so that we can automate this as an iteration over StringData objects. One (endonyms_data) gains a blank line that the others all had but it lacked. Change-Id: I96c014728a58343c82304c5117b474fee980d9c7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rework locale serialization and parsing with less repetitionEdward Welbourne2017-06-093-249/+255
| | | | | | | | | | | | | | | | ... 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>
* Clean up the output code for the big table of CLDR dataEdward Welbourne2017-06-081-9/+88
| | | | | | | | | | | | | | | | | | | Include headers for all fields (several were missing). Make field widths explicit to headers can line up with content. Use the same format for the (common part of the) all-zeros line. Document and lay-out headers and format string, to make them easier to keep in sync. Make a pair of comments clearer. Re-ran the script to regenerate the table: the result is best viewed with git show -w, to ignore the spacing changes (or git show -b to notice only the one harmless discrepancy exposed in old all-zeros data). Aside from spacing, locale_data[] has gained some missing columns in its header comment, which now lines headings up properly above actual data. Change-Id: I44242f38391353f2ec8e144cb7e8b54b0a359341 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Made the "do not edit generated code" notice clearerEdward Welbourne2017-06-082-3/+5
| | | | | | | | | Say where to find the scripts and make clear what to update to get changes. Change-Id: I424b7fdf846f7141c6df81eef90eb1ca0378bcf8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> 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-083-276/+155
| | | | | | | | | | | | | | | | 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>
* Fix CLDR C++ generation to name "Han with Bopomofo" properlyEdward Welbourne2017-06-082-2/+3
| | | | | | | | | | | | | | | We were using "Han With Bopomofo" (capitalized With) so that an enum member in qlocale.h would be suitably camel-case; however, this lead to spurious changes in qlocale_data_p.h where it names the script. Use the correct (lower-case with) form and arrange for the enum members to be generated with first letter of each word upper-case (but not with each word capitalize()d; some words in there are already camel-case, so .capitalize()ing would lower-case the later sub-words in these). Change-Id: I974c89dd40814eaf3bd538f06b9b4ebf17492f20 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Document how to use the CLDR-related scriptsEdward Welbourne2017-06-083-20/+46
| | | | | | | | 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>
* Re-generate QLocale data from CLDR v29Konstantin Ritt2016-04-082-7/+49
| | | | | | | | | | | * A bunch of fixes and additions to the locale data * Add new scripts from Unicode 8.0 and 9.0 * Map some potentially useful languages and territories [ChangeLog][QtCore] QLocale data updated to CLDR v29 Change-Id: I759ccb27fe19be2722be913c5c2e6aa5f36e5c14 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Re-generate TZ data from CLDR v29Konstantin Ritt2016-03-301-9/+7
| | | | | Change-Id: Ibc9c58e96c72ae9886946bcf2454f32552bd51a3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-2111-187/+132
| | | | | | | | | | | | | 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>
* Re-generate the time zones database from CLDR v.27Konstantin Ritt2015-03-271-88/+99
| | | | | | | [ChangeLog][QtCore] QTimeZone data updated to CLDR v.27 Change-Id: Ic25229d86ac4752ed70f5a729fd33c1a837241dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix time offset for several time zonesKonstantin Ritt2015-03-271-5/+5
| | | | | | | They are in UTC-03:00, not in UTC+03:00 (just a C&P typo). Change-Id: Ib342b65967404b8756c62953258b17421b9245af Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update CLDR to v27Konstantin Ritt2015-03-272-39/+84
| | | | | | | | | | | | | + 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>
* [locale database utility] Minor code deduplicationKonstantin Ritt2015-03-231-20/+9
| | | | | Change-Id: Ib6917940dfc410148d88e539cad2cdf7331a940d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [locale database utility] Optimize by caching the locale lookup chainKonstantin Ritt2015-03-231-0/+7
| | | | | Change-Id: I1b95b3365337753ca0ab782091fa61870b77b051 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [locale database utility] Fix inheritance chainKonstantin Ritt2015-03-231-1/+1
| | | | | | | | | | | | | Locales with an explicit parent locale should not inherit the language-default locale. For example, a correct chain for zh_Hant_MO is: zh_Hant_MO -> zh_Hant_HK -> zh_Hant -> root (two fixups: zh_Hant_HK and root, so that do not inherit zh) Fortunately, this didn't do any difference in a generated data. Change-Id: I92e09a95bd86f8723d8fe993f57d99af6f50db5e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed license headersJani Heikkinen2015-02-176-6/+6
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-1111-167/+119
| | | | | | | | | | | | | | | | | | 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 license headers and add new license filesMatti Paaso2014-09-245-95/+55
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Update the time zones database from CLDR v.24Konstantin Ritt2014-01-131-1/+2
| | | | | | Change-Id: Icab298f971980982412621a48c635a05f6ef5d36 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Update the internal CLDR tables up to v.24Konstantin Ritt2014-01-132-5/+18
| | | | | | | 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>
* QTimeZone - Change from Olson ID to IANA IDJohn Layt2014-01-111-13/+13
| | | | | | | | Complete changes from using Olsen/Olson in the code to IANA. Completes a change started in 5.2 release branch on the public occurrences. Change-Id: Ib077fcda2c77eef6f04ec28901d8d2d7210b8c72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Define new class and apiJohn Layt2013-09-221-0/+424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the new QTimeZone class based on the Olsen Time Zone ID's. This is the base implementation and does not include the Platform backends which are implemented separately. This change does include a default UTC backed to be used if no Platform backend is available, i.e. if QT_NO_SYSTEMLOCALE is set and ICU is not configured. This backend also provides a default set of time zones in the standard "UTC+00:00" offset format that are guaranteed to always exist regardless of the Platform backend. This change includes conversion functions between the Olsen ID's and Windows ID's using a conversion table based on Unicode CLDR data. This is implemented for all platforms for scenarios such as a Linux program needing to communicate with a Windows Exchange Server using the Windows ID. The CLDR conversion table is included under the UNICODE license, see http://unicode.org/copyright.html for details. [ChangeLog][QtCore][QTimeZone] Added new QTimeZone class to support time tone calculations using the host platform time zone database and the Olsen time zone ID's. Change-Id: Ibb417d08cf2663a0979d2be855d2c6ad6ad01509 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update QLocale locale database up to CLDR 23.1Konstantin Ritt2013-08-121-1/+2
| | | | | | | This only added Kosovo [XK] territory and few valid locales for it. Change-Id: Ia0b47041ed5cd1303b5bc233f2502a3725c74da9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update QLocale data to CLDRv23Konstantin Ritt2013-04-012-2/+4
| | | | | | | | Say hello to Interlingua and Mongolian once again. Change-Id: I735fbc5793f34620be1f6932a251224b9ded02e3 Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocale: Add some more languages and scriptsKonstantin Ritt2013-03-052-4/+129
| | | | | Change-Id: Iab23128c1567974154cdcce7412b2e1468bb8462 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-281-1/+1
| | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1810-10/+10
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Always use QAIM to get the default flags.Stephen Kelly2012-11-281-2/+2
| | | | | Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>