summaryrefslogtreecommitdiffstats
path: root/util/local_database
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* [SIC] QLocale: Update some language names with their modern valuesKonstantin Ritt2012-11-242-8/+10
| | | | | | | | Some of them were incorrectly spelled (for a while) Change-Id: I871968e3bbdd2172f4c4dfb6e74729c05e7e8e01 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update Qlocale data up to CLDR 22.1Konstantin Ritt2012-11-212-5/+15
| | | | | Change-Id: Ie6ddfec14cb052e0b89230dc93290ff79488fb25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update Qlocale data up to CLDR 2.0.1Konstantin Ritt2012-11-212-6/+56
| | | | | Change-Id: I4279fac57436d7009a6d61dab5936b72fd39fc14 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use likelySubtags to instantiate a locale id from it's short formKonstantin Ritt2012-11-212-32/+120
| | | | | | | | | ...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-213-72/+117
| | | | | | | | | | 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-192-111/+98
| | | | | | | | | | ...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-152-11/+13
| | | | | | | as their meaning, in fact, is unknown (or default) country/script. Change-Id: Id75a70d4b33c2092de414f3ac357f6bcb627ba47 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a bunch of missed scriptsKonstantin Ritt2012-11-151-1/+26
| | | | | Change-Id: I078bf95cb50c7ef634f9f3133ab9f9d25439e4ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add missing Bodo language introduced in CLDR 1.9.1Konstantin Ritt2012-11-151-1/+2
| | | | | Change-Id: I4feb6ba781299d65ff3bf2717f08a0ac7eae7928 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Misc fixes to the QLocale data parser/generatorKonstantin Ritt2012-11-154-31/+19
| | | | | Change-Id: I01589eae4e48bc1f484d54277de8f18262ca8f31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2210-242/+242
| | | | | | | | 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>
* QLocale: Clean up QLocalePrivate implementationJohn Layt2012-04-241-1/+1
| | | | | | | | | | | | | | In Qt4 QLocalePrivate is a struct returned by a d() method. This will be unsuitable for the planned change to use ICU and may cause BIC issues. This change makes QLocalePrivate a class and creates a new struct QLocaleData to hold the data index. Further clean-ups are possible but are left for later. Change-Id: Ie316a07790f74674a3b520b735dff72695cc4060 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocale: Merge month name data storage to save 50KB memoryJohn Layt2012-04-031-12/+3
| | | | | | | | | | | | Month Names and Standalone Month Names are stored separately, but for majority of locales the names are the same and so storage is duplicated. By storing both sets of names in the same array 50KB is saved in libQtCore.so on Linux. Depends on change Ic84bbc82 in branch api_review for CLDR 1.9.1 Change-Id: I83224ebc2180ee6de69797fa50d38348acc94107 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.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>