diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/edid/qedidvendortable.py | 9 | ||||
-rw-r--r-- | util/gradientgen/.gitignore | 2 | ||||
-rwxr-xr-x | util/gradientgen/gradientgen.js | 133 | ||||
-rw-r--r-- | util/gradientgen/package-lock.json | 183 | ||||
-rw-r--r-- | util/gradientgen/package.json | 13 | ||||
-rw-r--r-- | util/gradientgen/tobinaryjson.cpp | 54 | ||||
-rw-r--r-- | util/gradientgen/tobinaryjson.pro | 4 | ||||
-rwxr-xr-x | util/local_database/cldr2qlocalexml.py | 47 | ||||
-rw-r--r-- | util/local_database/enumdata.py | 1576 | ||||
-rwxr-xr-x | util/local_database/qlocalexml2cpp.py | 66 | ||||
-rw-r--r-- | util/unicode/main.cpp | 8 | ||||
-rwxr-xr-x | util/x86simdgen/generate.pl | 199 | ||||
-rw-r--r-- | util/x86simdgen/simd.txt | 37 |
13 files changed, 1507 insertions, 824 deletions
diff --git a/util/edid/qedidvendortable.py b/util/edid/qedidvendortable.py index bac8417326..6fc45dbc17 100755 --- a/util/edid/qedidvendortable.py +++ b/util/edid/qedidvendortable.py @@ -29,7 +29,10 @@ import urllib.request -url = 'https://git.fedorahosted.org/cgit/hwdata.git/plain/pnp.ids' +# The original source for this data used to be +# 'https://git.fedorahosted.org/cgit/hwdata.git/plain/pnp.ids' +# which is discontinued. For now there seems to be a fork at: +url = 'https://github.com/vcrhonek/hwdata/raw/master/pnp.ids' copyright = """/**************************************************************************** ** @@ -74,7 +77,7 @@ copyright = """/**************************************************************** notice = """/* * This lookup table was generated from {} * - * Do not change directly this file, instead edit the + * Do not change this file directly, instead edit the * qtbase/util/edid/qedidvendortable.py script and regenerate this file. */""".format(url) @@ -129,6 +132,6 @@ for line in data.split('\n'): print(copyright) print(notice) print(header % (max_vendor_length + 1)) -for pnp_id in vendors.keys(): +for pnp_id in sorted(vendors.keys()): print(' { "%s", "%s" },' % (pnp_id, vendors[pnp_id])) print(footer) diff --git a/util/gradientgen/.gitignore b/util/gradientgen/.gitignore new file mode 100644 index 0000000000..1a8e824bee --- /dev/null +++ b/util/gradientgen/.gitignore @@ -0,0 +1,2 @@ +node_modules +tobinaryjson diff --git a/util/gradientgen/gradientgen.js b/util/gradientgen/gradientgen.js new file mode 100755 index 0000000000..434f05b2bb --- /dev/null +++ b/util/gradientgen/gradientgen.js @@ -0,0 +1,133 @@ +#! /usr/bin/env node + +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the utils of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +const _ = require('lodash'); +const fs = require('fs'); + +const postcss = require('postcss'); +const minifyGradients = require('postcss-minify-gradients'); +const valueParser = require('postcss-value-parser'); +const parseColor = require('parse-color'); +const math = require('mathjs'); + +const argc = process.argv.length; +if (argc < 3) { + console.log("usage: gradientgen [mode] <filename>"); + process.exit(1); +} + +const filename = process.argv[argc - 1]; +const mode = argc > 3 ? process.argv[argc - 2] : 'json'; + +fs.readFile(filename, (err, css) => { + postcss([minifyGradients]).process(css) + .then(result => { + let enums = []; + let gradients = []; + + result.root.walkRules(rule => { + gradients.push(null); // Placeholder + + const name = _.startCase(rule.selector).replace(/\s/g, ''); + if (enums.indexOf(name) >= 0) + return; // Duplicate entry + + // We can only support single gradient declarations + if (rule.nodes.length > 1) + return; + + valueParser(rule.nodes[0].value).walk(node => { + if (node.type !== 'function') + return; + + if (node.value !== 'linear-gradient') + return; + + const args = node.nodes.reduce((args, arg) => { + if (arg.type === 'div') + args.push([]); + else if (arg.type !== 'space') + args[args.length - 1].push(arg.value); + return args; + }, [[]]); + + let angle = valueParser.unit(args[0][0]); + if (angle.unit !== 'deg') + return; + + angle = parseInt(angle.number); + if (angle < 0) + angle += 360; + + // Angle is in degrees, but we need radians + const radians = angle * math.pi / 180; + + const gradientLine = (math.abs(math.sin(radians)) + math.abs(math.cos(radians))); + const cathetus = fn => math.round(fn(radians - math.pi / 2) * gradientLine / 2, 10); + + const x = cathetus(math.cos); + const y = cathetus(math.sin); + + const start = { x: 0.5 - x, y: 0.5 - y }; + const end = { x: 0.5 + x, y: 0.5 + y }; + + let stops = [] + + let lastPosition = 0; + args.slice(1).forEach((arg, index) => { + let [color, position = !index ? '0%' : '100%'] = arg; + position = parseInt(position) / 100; + if (position < lastPosition) + position = lastPosition; + lastPosition = position; + color = parseColor(color).hex; + color = parseInt(color.slice(1), 16) + stops.push({ color, position }) + }); + + gradients[gradients.length - 1] = { start, end, stops }; + }); + + if (!gradients[gradients.length - 1]) + return; // Not supported + + enums.push(name); + + if (mode == 'debug') + console.log(name, args, gradients[gradients.length - 1]) + else if (mode == 'enums') + console.log(`${name} = ${gradients.length},`) + }); + + // Done walking declarations + if (mode == 'json') + console.log(JSON.stringify(gradients, undefined, 4)); + }); +}); diff --git a/util/gradientgen/package-lock.json b/util/gradientgen/package-lock.json new file mode 100644 index 0000000000..77939b7fe3 --- /dev/null +++ b/util/gradientgen/package-lock.json @@ -0,0 +1,183 @@ +{ + "name": "gradientgen", + "version": "0.0.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "complex.js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.4.tgz", + "integrity": "sha512-Syl95HpxUTS0QjwNxencZsKukgh1zdS9uXeXX2Us0pHaqBR6kiZZi0AkZ9VpZFwHJyVIUVzI4EumjWdXP3fy6w==" + }, + "decimal.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-9.0.1.tgz", + "integrity": "sha512-2h0iKbJwnImBk4TGk7CG1xadoA0g3LDPlQhQzbZ221zvG0p2YVUedbKIPsOZXKZGx6YmZMJKYOalpCMxSdDqTQ==" + }, + "escape-latex": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.0.3.tgz", + "integrity": "sha512-GfKaG/7FOKdIdciylIzgaShBTPjdGQ5LJ2EcKLKXPLpcMO1MvCEVotkhydEShwCINRacZr2r3fk5A1PwZ4e5sA==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "fraction.js": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.4.tgz", + "integrity": "sha512-aK/oGatyYLTtXRHjfEsytX5fieeR5H4s8sLorzcT12taFS+dbMZejnvm9gRa8mZAPwci24ucjq9epDyaq5u8Iw==" + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + }, + "javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" + }, + "js-base64": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", + "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==" + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "mathjs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-4.2.2.tgz", + "integrity": "sha512-AKrRfTeGrCBqYN1TYEpLIwrfZh9rKu9lH4n7K0MwTiYqN5crJ7BKh/TnErFvbUmyRVQDv87UjSfNTqeO0JA0JQ==", + "requires": { + "complex.js": "2.0.4", + "decimal.js": "9.0.1", + "escape-latex": "1.0.3", + "fraction.js": "4.0.4", + "javascript-natural-sort": "0.7.1", + "seed-random": "2.2.0", + "tiny-emitter": "2.0.2", + "typed-function": "1.0.3" + } + }, + "parse-color": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz", + "integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=", + "requires": { + "color-convert": "0.5.3" + }, + "dependencies": { + "color-convert": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", + "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=" + } + } + }, + "postcss": { + "version": "5.2.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "requires": { + "chalk": "1.1.3", + "js-base64": "2.4.3", + "source-map": "0.5.7", + "supports-color": "3.2.3" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "postcss-minify-gradients": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", + "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", + "requires": { + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=" + }, + "seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "requires": { + "has-flag": "1.0.0" + } + }, + "tiny-emitter": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", + "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" + }, + "typed-function": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-1.0.3.tgz", + "integrity": "sha512-sVC/1pm70oELDFMdYtFXMFqyawenLoaDiAXA3QvOAwKF/WvFNTSJN23cY2lFNL8iP0kh3T0PPKewrboO8XUVGQ==" + } + } +} diff --git a/util/gradientgen/package.json b/util/gradientgen/package.json new file mode 100644 index 0000000000..35c324b8cc --- /dev/null +++ b/util/gradientgen/package.json @@ -0,0 +1,13 @@ +{ + "name": "gradientgen", + "version": "0.0.1", + "description": "Generates gradient presets for QGradient", + "main": "gradientgen.js", + "dependencies": { + "lodash": "^4.17.10", + "mathjs": "^4.2.2", + "parse-color": "^1.0.0", + "postcss-minify-gradients": "^1.0.5", + "postcss-value-parser": "^3.3.0" + } +} diff --git a/util/gradientgen/tobinaryjson.cpp b/util/gradientgen/tobinaryjson.cpp new file mode 100644 index 0000000000..65fe07f4b8 --- /dev/null +++ b/util/gradientgen/tobinaryjson.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the utils of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <iostream> + +#include <qdebug.h> +#include <qjsondocument.h> + +using namespace std; + +int main() +{ + QByteArray json; + while (!cin.eof()) { + char arr[1024]; + cin.read(arr, sizeof(arr)); + json.append(arr, cin.gcount()); + } + + QJsonParseError error; + QJsonDocument document = QJsonDocument::fromJson(json, &error); + if (document.isNull()) { + qDebug() << "error:" << qPrintable(error.errorString()) << "at offset" << error.offset; + return 1; + } + + QByteArray binaryJson = document.toBinaryData(); + cout.write(binaryJson.constData(), binaryJson.size()); +} diff --git a/util/gradientgen/tobinaryjson.pro b/util/gradientgen/tobinaryjson.pro new file mode 100644 index 0000000000..8ed3509278 --- /dev/null +++ b/util/gradientgen/tobinaryjson.pro @@ -0,0 +1,4 @@ +SOURCES += tobinaryjson.cpp +QT = core +CONFIG += console +CONFIG -= app_bundle diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index 58ea21edab..ce45f631a6 100755 --- a/util/local_database/cldr2qlocalexml.py +++ b/util/local_database/cldr2qlocalexml.py @@ -37,6 +37,14 @@ pass the path of that sub-directory to this script as its single command-line argument. Save its standard output (but not error) to a file for later processing by ``./qlocalexml2cpp.py`` +When you update the CLDR data, be sure to also update +src/corelib/tools/qt_attribution.json's entry for unicode-cldr. Check +this script's output for unknown language, country or script messages; +if any can be resolved, use their entry in common/main/en.xml to +append new entries to enumdata.py's lists and update documentation in +src/corelib/tools/qlocale.qdoc, adding the new entries in alphabetic +order. + .. _CLDR: ftp://unicode.org/Public/cldr/ """ @@ -142,6 +150,28 @@ def generateLocaleInfo(path): return _generateLocaleInfo(path, code('language'), code('script'), code('territory'), code('variant')) +def getNumberSystems(cache={}): + """Cached look-up of number system information. + + Pass no arguments. Returns a mapping from number system names to, + for each system, a mapping with keys u'digits', u'type' and + u'id'\n""" + if not cache: + for ns in findTagsInFile(os.path.join(cldr_dir, '..', 'supplemental', + 'numberingSystems.xml'), + 'numberingSystems'): + # ns has form: [u'numberingSystem', [(u'digits', u'0123456789'), (u'type', u'numeric'), (u'id', u'latn')]] + entry = dict(ns[1]) + name = entry[u'id'] + if u'digits' in entry and ord(entry[u'digits'][0]) > 0xffff: + # FIXME: make this redundant: + # omit number system if zero doesn't fit in single-char16 UTF-16 :-( + sys.stderr.write('skipping number system "%s" [can\'t represent its zero, U+%X, QTBUG-69324]\n' + % (name, ord(entry[u'digits'][0]))) + else: + cache[name] = entry + return cache + def _generateLocaleInfo(path, language_code, script_code, country_code, variant_code=""): if not path.endswith(".xml"): return {} @@ -239,20 +269,9 @@ def _generateLocaleInfo(path, language_code, script_code, country_code, variant_ result['list'] = get_number_in_system(path, "numbers/symbols/list", numbering_system) result['percent'] = get_number_in_system(path, "numbers/symbols/percentSign", numbering_system) try: - numbering_systems = {} - for ns in findTagsInFile(os.path.join(cldr_dir, '..', 'supplemental', - 'numberingSystems.xml'), - 'numberingSystems'): - tmp = {} - id = "" - for data in ns[1:][0]: # ns looks like this: [u'numberingSystem', [(u'digits', u'0123456789'), (u'type', u'numeric'), (u'id', u'latn')]] - tmp[data[0]] = data[1] - if data[0] == u"id": - id = data[1] - numbering_systems[id] = tmp - result['zero'] = numbering_systems[numbering_system][u"digits"][0] - except e: - sys.stderr.write("Native zero detection problem:\n" + str(e) + "\n") + result['zero'] = getNumberSystems()[numbering_system][u"digits"][0] + except Exception as e: + sys.stderr.write("Native zero detection problem: %s\n" % repr(e)) result['zero'] = get_number_in_system(path, "numbers/symbols/nativeZeroDigit", numbering_system) result['minus'] = get_number_in_system(path, "numbers/symbols/minusSign", numbering_system) result['plus'] = get_number_in_system(path, "numbers/symbols/plusSign", numbering_system) diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py index 2d16e5851d..e24ac02b07 100644 --- a/util/local_database/enumdata.py +++ b/util/local_database/enumdata.py @@ -27,779 +27,825 @@ ## ############################################################################# -# language_list and country_list reflect the current values of enums in qlocale.h -# If new xml language files are available in CLDR, these languages and countries -# need to be *appended* to this list. +# Each *_list reflects the current values of its enums in qlocale.h; +# if new xml language files are available in CLDR, these languages and +# countries need to be *appended* to this list (for compatibility +# between versions). Include any spaces present in names (scripts +# shall squish them out for the enum entries) in *_list, but use the +# squished forms of names in the *_aliases mappings. + +### Qt 6: restore alphabetic order in each list. language_list = { - 0 : [ "AnyLanguage", " " ], - 1 : [ "C", " " ], - 2 : [ "Abkhazian", "ab" ], - 3 : [ "Oromo", "om" ], # macrolanguage - 4 : [ "Afar", "aa" ], - 5 : [ "Afrikaans", "af" ], - 6 : [ "Albanian", "sq" ], # macrolanguage - 7 : [ "Amharic", "am" ], - 8 : [ "Arabic", "ar" ], # macrolanguage - 9 : [ "Armenian", "hy" ], - 10 : [ "Assamese", "as" ], - 11 : [ "Aymara", "ay" ], # macrolanguage - 12 : [ "Azerbaijani", "az" ], # macrolanguage - 13 : [ "Bashkir", "ba" ], - 14 : [ "Basque", "eu" ], - 15 : [ "Bengali", "bn" ], - 16 : [ "Dzongkha", "dz" ], - 17 : [ "Bihari", "bh" ], - 18 : [ "Bislama", "bi" ], - 19 : [ "Breton", "br" ], - 20 : [ "Bulgarian", "bg" ], - 21 : [ "Burmese", "my" ], - 22 : [ "Belarusian", "be" ], - 23 : [ "Khmer", "km" ], - 24 : [ "Catalan", "ca" ], - 25 : [ "Chinese", "zh" ], # macrolanguage - 26 : [ "Corsican", "co" ], - 27 : [ "Croatian", "hr" ], - 28 : [ "Czech", "cs" ], - 29 : [ "Danish", "da" ], - 30 : [ "Dutch", "nl" ], - 31 : [ "English", "en" ], - 32 : [ "Esperanto", "eo" ], - 33 : [ "Estonian", "et" ], # macrolanguage - 34 : [ "Faroese", "fo" ], - 35 : [ "Fijian", "fj" ], - 36 : [ "Finnish", "fi" ], - 37 : [ "French", "fr" ], - 38 : [ "Western Frisian", "fy" ], - 39 : [ "Gaelic", "gd" ], - 40 : [ "Galician", "gl" ], - 41 : [ "Georgian", "ka" ], - 42 : [ "German", "de" ], - 43 : [ "Greek", "el" ], - 44 : [ "Greenlandic", "kl" ], - 45 : [ "Guarani", "gn" ], # macrolanguage - 46 : [ "Gujarati", "gu" ], - 47 : [ "Hausa", "ha" ], - 48 : [ "Hebrew", "he" ], - 49 : [ "Hindi", "hi" ], - 50 : [ "Hungarian", "hu" ], - 51 : [ "Icelandic", "is" ], - 52 : [ "Indonesian", "id" ], - 53 : [ "Interlingua", "ia" ], - 54 : [ "Interlingue", "ie" ], - 55 : [ "Inuktitut", "iu" ], # macrolanguage - 56 : [ "Inupiak", "ik" ], # macrolanguage - 57 : [ "Irish", "ga" ], - 58 : [ "Italian", "it" ], - 59 : [ "Japanese", "ja" ], - 60 : [ "Javanese", "jv" ], - 61 : [ "Kannada", "kn" ], - 62 : [ "Kashmiri", "ks" ], - 63 : [ "Kazakh", "kk" ], - 64 : [ "Kinyarwanda", "rw" ], - 65 : [ "Kirghiz", "ky" ], - 66 : [ "Korean", "ko" ], - 67 : [ "Kurdish", "ku" ], # macrolanguage - 68 : [ "Rundi", "rn" ], - 69 : [ "Lao", "lo" ], - 70 : [ "Latin", "la" ], - 71 : [ "Latvian", "lv" ], # macrolanguage - 72 : [ "Lingala", "ln" ], - 73 : [ "Lithuanian", "lt" ], - 74 : [ "Macedonian", "mk" ], - 75 : [ "Malagasy", "mg" ], # macrolanguage - 76 : [ "Malay", "ms" ], # macrolanguage - 77 : [ "Malayalam", "ml" ], - 78 : [ "Maltese", "mt" ], - 79 : [ "Maori", "mi" ], - 80 : [ "Marathi", "mr" ], - 81 : [ "Marshallese", "mh" ], - 82 : [ "Mongolian", "mn" ], # macrolanguage - 83 : [ "Nauru", "na" ], - 84 : [ "Nepali", "ne" ], # macrolanguage - 85 : [ "NorwegianBokmal", "nb" ], - 86 : [ "Occitan", "oc" ], - 87 : [ "Oriya", "or" ], # macrolanguage - 88 : [ "Pashto", "ps" ], # macrolanguage - 89 : [ "Persian", "fa" ], # macrolanguage - 90 : [ "Polish", "pl" ], - 91 : [ "Portuguese", "pt" ], - 92 : [ "Punjabi", "pa" ], - 93 : [ "Quechua", "qu" ], # macrolanguage - 94 : [ "Romansh", "rm" ], - 95 : [ "Romanian", "ro" ], - 96 : [ "Russian", "ru" ], - 97 : [ "Samoan", "sm" ], - 98 : [ "Sango", "sg" ], - 99 : [ "Sanskrit", "sa" ], - 100 : [ "Serbian", "sr" ], - 101 : [ "Ossetic", "os" ], - 102 : [ "Southern Sotho", "st" ], - 103 : [ "Tswana", "tn" ], - 104 : [ "Shona", "sn" ], - 105 : [ "Sindhi", "sd" ], - 106 : [ "Sinhala", "si" ], - 107 : [ "Swati", "ss" ], - 108 : [ "Slovak", "sk" ], - 109 : [ "Slovenian", "sl" ], - 110 : [ "Somali", "so" ], - 111 : [ "Spanish", "es" ], - 112 : [ "Sundanese", "su" ], - 113 : [ "Swahili", "sw" ], # macrolanguage - 114 : [ "Swedish", "sv" ], - 115 : [ "Sardinian", "sc" ], # macrolanguage - 116 : [ "Tajik", "tg" ], - 117 : [ "Tamil", "ta" ], - 118 : [ "Tatar", "tt" ], - 119 : [ "Telugu", "te" ], - 120 : [ "Thai", "th" ], - 121 : [ "Tibetan", "bo" ], - 122 : [ "Tigrinya", "ti" ], - 123 : [ "Tongan", "to" ], - 124 : [ "Tsonga", "ts" ], - 125 : [ "Turkish", "tr" ], - 126 : [ "Turkmen", "tk" ], - 127 : [ "Tahitian", "ty" ], - 128 : [ "Uighur", "ug" ], - 129 : [ "Ukrainian", "uk" ], - 130 : [ "Urdu", "ur" ], - 131 : [ "Uzbek", "uz" ], # macrolanguage - 132 : [ "Vietnamese", "vi" ], - 133 : [ "Volapuk", "vo" ], - 134 : [ "Welsh", "cy" ], - 135 : [ "Wolof", "wo" ], - 136 : [ "Xhosa", "xh" ], - 137 : [ "Yiddish", "yi" ], # macrolanguage - 138 : [ "Yoruba", "yo" ], - 139 : [ "Zhuang", "za" ], # macrolanguage - 140 : [ "Zulu", "zu" ], - 141 : [ "NorwegianNynorsk", "nn" ], - 142 : [ "Bosnian", "bs" ], - 143 : [ "Divehi", "dv" ], - 144 : [ "Manx", "gv" ], - 145 : [ "Cornish", "kw" ], - 146 : [ "Akan", "ak" ], # macrolanguage - 147 : [ "Konkani", "kok" ], - 148 : [ "Ga", "gaa" ], - 149 : [ "Igbo", "ig" ], - 150 : [ "Kamba", "kam" ], - 151 : [ "Syriac", "syr" ], - 152 : [ "Blin", "byn" ], - 153 : [ "Geez", "gez" ], - 154 : [ "Koro", "kfo" ], - 155 : [ "Sidamo", "sid" ], - 156 : [ "Atsam", "cch" ], - 157 : [ "Tigre", "tig" ], - 158 : [ "Jju", "kaj" ], - 159 : [ "Friulian", "fur" ], - 160 : [ "Venda", "ve" ], - 161 : [ "Ewe", "ee" ], - 162 : [ "Walamo", "wal" ], - 163 : [ "Hawaiian", "haw" ], - 164 : [ "Tyap", "kcg" ], - 165 : [ "Nyanja", "ny" ], - 166 : [ "Filipino", "fil" ], - 167 : [ "Swiss German", "gsw" ], - 168 : [ "Sichuan Yi", "ii" ], - 169 : [ "Kpelle", "kpe" ], - 170 : [ "Low German", "nds" ], - 171 : [ "South Ndebele", "nr" ], - 172 : [ "Northern Sotho", "nso" ], - 173 : [ "Northern Sami", "se" ], - 174 : [ "Taroko", "trv" ], - 175 : [ "Gusii", "guz" ], - 176 : [ "Taita", "dav" ], - 177 : [ "Fulah", "ff" ], # macrolanguage - 178 : [ "Kikuyu", "ki" ], - 179 : [ "Samburu", "saq" ], - 180 : [ "Sena", "seh" ], - 181 : [ "North Ndebele", "nd" ], - 182 : [ "Rombo", "rof" ], - 183 : [ "Tachelhit", "shi" ], - 184 : [ "Kabyle", "kab" ], - 185 : [ "Nyankole", "nyn" ], - 186 : [ "Bena", "bez" ], - 187 : [ "Vunjo", "vun" ], - 188 : [ "Bambara", "bm" ], - 189 : [ "Embu", "ebu" ], - 190 : [ "Cherokee", "chr" ], - 191 : [ "Morisyen", "mfe" ], - 192 : [ "Makonde", "kde" ], - 193 : [ "Langi", "lag" ], - 194 : [ "Ganda", "lg" ], - 195 : [ "Bemba", "bem" ], - 196 : [ "Kabuverdianu", "kea" ], - 197 : [ "Meru", "mer" ], - 198 : [ "Kalenjin", "kln" ], - 199 : [ "Nama", "naq" ], - 200 : [ "Machame", "jmc" ], - 201 : [ "Colognian", "ksh" ], - 202 : [ "Masai", "mas" ], - 203 : [ "Soga", "xog" ], - 204 : [ "Luyia", "luy" ], - 205 : [ "Asu", "asa" ], - 206 : [ "Teso", "teo" ], - 207 : [ "Saho", "ssy" ], - 208 : [ "Koyra Chiini", "khq" ], - 209 : [ "Rwa", "rwk" ], - 210 : [ "Luo", "luo" ], - 211 : [ "Chiga", "cgg" ], - 212 : [ "Central Morocco Tamazight", "tzm" ], - 213 : [ "Koyraboro Senni", "ses" ], - 214 : [ "Shambala", "ksb" ], - 215 : [ "Bodo", "brx" ], - 216 : [ "Avaric", "av" ], - 217 : [ "Chamorro", "ch" ], - 218 : [ "Chechen", "ce" ], - 219 : [ "Church", "cu" ], # macrolanguage - 220 : [ "Chuvash", "cv" ], - 221 : [ "Cree", "cr" ], # macrolanguage - 222 : [ "Haitian", "ht" ], - 223 : [ "Herero", "hz" ], - 224 : [ "Hiri Motu", "ho" ], - 225 : [ "Kanuri", "kr" ], # macrolanguage - 226 : [ "Komi", "kv" ], # macrolanguage - 227 : [ "Kongo", "kg" ], # macrolanguage - 228 : [ "Kwanyama", "kj" ], - 229 : [ "Limburgish", "li" ], - 230 : [ "LubaKatanga", "lu" ], - 231 : [ "Luxembourgish", "lb" ], - 232 : [ "Navaho", "nv" ], - 233 : [ "Ndonga", "ng" ], - 234 : [ "Ojibwa", "oj" ], # macrolanguage - 235 : [ "Pali", "pi" ], # macrolanguage - 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" ], - 255 : [ "Avestan", "ae" ], - 256 : [ "Asturian", "ast" ], - 257 : [ "Ngomba", "jgo" ], - 258 : [ "Kako", "kkj" ], - 259 : [ "Meta", "mgo" ], - 260 : [ "Ngiemboon", "nnh" ], - 261 : [ "Aragonese", "an" ], - 262 : [ "Akkadian", "akk" ], - 263 : [ "AncientEgyptian", "egy" ], - 264 : [ "AncientGreek", "grc" ], - 265 : [ "Aramaic", "arc" ], - 266 : [ "Balinese", "ban" ], - 267 : [ "Bamun", "bax" ], - 268 : [ "BatakToba", "bbc" ], - 269 : [ "Buginese", "bug" ], - 270 : [ "Buhid", "bku" ], - 271 : [ "Carian", "xcr" ], - 272 : [ "Chakma", "ccp" ], - 273 : [ "ClassicalMandaic", "myz" ], - 274 : [ "Coptic", "cop" ], - 275 : [ "Dogri", "doi" ], # macrolanguage - 276 : [ "EasternCham", "cjm" ], - 277 : [ "EasternKayah", "eky" ], - 278 : [ "Etruscan", "ett" ], - 279 : [ "Gothic", "got" ], - 280 : [ "Hanunoo", "hnn" ], - 281 : [ "Ingush", "inh" ], - 282 : [ "LargeFloweryMiao", "hmd" ], - 283 : [ "Lepcha", "lep" ], - 284 : [ "Limbu", "lif" ], - 285 : [ "Lisu", "lis" ], - 286 : [ "Lu", "khb" ], - 287 : [ "Lycian", "xlc" ], - 288 : [ "Lydian", "xld" ], - 289 : [ "Mandingo", "man" ], # macrolanguage - 290 : [ "Manipuri", "mni" ], - 291 : [ "Meroitic", "xmr" ], - 292 : [ "NorthernThai", "nod" ], - 293 : [ "OldIrish", "sga" ], - 294 : [ "OldNorse", "non" ], - 295 : [ "OldPersian", "peo" ], - 296 : [ "OldTurkish", "otk" ], - 297 : [ "Pahlavi", "pal" ], - 298 : [ "Parthian", "xpr" ], - 299 : [ "Phoenician", "phn" ], - 300 : [ "PrakritLanguage", "pra" ], - 301 : [ "Rejang", "rej" ], - 302 : [ "Sabaean", "xsa" ], - 303 : [ "Samaritan", "smp" ], - 304 : [ "Santali", "sat" ], - 305 : [ "Saurashtra", "saz" ], - 306 : [ "Sora", "srb" ], - 307 : [ "Sylheti", "syl" ], - 308 : [ "Tagbanwa", "tbw" ], - 309 : [ "TaiDam", "blt" ], - 310 : [ "TaiNua", "tdd" ], - 311 : [ "Ugaritic", "uga" ], - 312 : [ "Akoose", "bss" ], - 313 : [ "Lakota", "lkt" ], - 314 : [ "Standard Moroccan Tamazight", "zgh" ], - 315 : [ "Mapuche", "arn" ], - 316 : [ "Central Kurdish", "ckb" ], - 317 : [ "LowerSorbian", "dsb" ], - 318 : [ "UpperSorbian", "hsb" ], - 319 : [ "Kenyang", "ken" ], - 320 : [ "Mohawk", "moh" ], - 321 : [ "Nko", "nqo" ], - 322 : [ "Prussian", "prg" ], - 323 : [ "Kiche", "quc" ], - 324 : [ "Southern Sami", "sma" ], - 325 : [ "Lule Sami", "smj" ], - 326 : [ "Inari Sami", "smn" ], - 327 : [ "Skolt Sami", "sms" ], - 328 : [ "Warlpiri", "wbp" ], - 329 : [ "Manichaean Middle Persian", "xmn" ], - 330 : [ "Mende", "men" ], - 331 : [ "Ancient North Arabian", "xna" ], - 332 : [ "Linear A", "lab" ], - 333 : [ "Hmong Njua", "hnj" ], - 334 : [ "Ho", "hoc" ], - 335 : [ "Lezghian", "lez" ], - 336 : [ "Bassa", "bsq" ], - 337 : [ "Mono", "mru" ], - 338 : [ "Tedim Chin", "ctd" ], - 339 : [ "Maithili", "mai" ], - 340 : [ "Ahom", "aho" ], - 341 : [ "American Sign Language", "ase" ], - 342 : [ "Ardhamagadhi Prakrit", "pka" ], - 343 : [ "Bhojpuri", "bho" ], - 344 : [ "Hieroglyphic Luwian", "hlu" ], - 345 : [ "Literary Chinese", "lzh" ], - 346 : [ "Mazanderani", "mzn" ], - 347 : [ "Mru", "mro" ], - 348 : [ "Newari", "new" ], - 349 : [ "Northern Luri", "lrc" ], - 350 : [ "Palauan", "pau" ], - 351 : [ "Papiamento", "pap" ], - 352 : [ "Saraiki", "skr" ], - 353 : [ "Tokelau", "tkl" ], - 354 : [ "Tok Pisin", "tpi" ], - 355 : [ "Tuvalu", "tvl" ], - 356 : [ "UncodedLanguages", "mis" ], - 357 : [ "Cantonese", "yue" ], - 358 : [ "Osage", "osa" ], - 359 : [ "Tangut", "txg" ] + 0 : ["AnyLanguage", " "], + 1 : ["C", " "], + 2 : ["Abkhazian", "ab"], + 3 : ["Oromo", "om"], # macrolanguage + 4 : ["Afar", "aa"], + 5 : ["Afrikaans", "af"], + 6 : ["Albanian", "sq"], # macrolanguage + 7 : ["Amharic", "am"], + 8 : ["Arabic", "ar"], # macrolanguage + 9 : ["Armenian", "hy"], + 10 : ["Assamese", "as"], + 11 : ["Aymara", "ay"], # macrolanguage + 12 : ["Azerbaijani", "az"], # macrolanguage + 13 : ["Bashkir", "ba"], + 14 : ["Basque", "eu"], + 15 : ["Bengali", "bn"], + 16 : ["Dzongkha", "dz"], + 17 : ["Bihari", "bh"], + 18 : ["Bislama", "bi"], + 19 : ["Breton", "br"], + 20 : ["Bulgarian", "bg"], + 21 : ["Burmese", "my"], + 22 : ["Belarusian", "be"], + 23 : ["Khmer", "km"], + 24 : ["Catalan", "ca"], + 25 : ["Chinese", "zh"], # macrolanguage + 26 : ["Corsican", "co"], + 27 : ["Croatian", "hr"], + 28 : ["Czech", "cs"], + 29 : ["Danish", "da"], + 30 : ["Dutch", "nl"], + 31 : ["English", "en"], + 32 : ["Esperanto", "eo"], + 33 : ["Estonian", "et"], # macrolanguage + 34 : ["Faroese", "fo"], + 35 : ["Fijian", "fj"], + 36 : ["Finnish", "fi"], + 37 : ["French", "fr"], + 38 : ["Western Frisian", "fy"], + 39 : ["Gaelic", "gd"], + 40 : ["Galician", "gl"], + 41 : ["Georgian", "ka"], + 42 : ["German", "de"], + 43 : ["Greek", "el"], + 44 : ["Greenlandic", "kl"], + 45 : ["Guarani", "gn"], # macrolanguage + 46 : ["Gujarati", "gu"], + 47 : ["Hausa", "ha"], + 48 : ["Hebrew", "he"], + 49 : ["Hindi", "hi"], + 50 : ["Hungarian", "hu"], + 51 : ["Icelandic", "is"], + 52 : ["Indonesian", "id"], + 53 : ["Interlingua", "ia"], + 54 : ["Interlingue", "ie"], + 55 : ["Inuktitut", "iu"], # macrolanguage + 56 : ["Inupiak", "ik"], # macrolanguage + 57 : ["Irish", "ga"], + 58 : ["Italian", "it"], + 59 : ["Japanese", "ja"], + 60 : ["Javanese", "jv"], + 61 : ["Kannada", "kn"], + 62 : ["Kashmiri", "ks"], + 63 : ["Kazakh", "kk"], + 64 : ["Kinyarwanda", "rw"], + 65 : ["Kirghiz", "ky"], + 66 : ["Korean", "ko"], + 67 : ["Kurdish", "ku"], # macrolanguage + 68 : ["Rundi", "rn"], + 69 : ["Lao", "lo"], + 70 : ["Latin", "la"], + 71 : ["Latvian", "lv"], # macrolanguage + 72 : ["Lingala", "ln"], + 73 : ["Lithuanian", "lt"], + 74 : ["Macedonian", "mk"], + 75 : ["Malagasy", "mg"], # macrolanguage + 76 : ["Malay", "ms"], # macrolanguage + 77 : ["Malayalam", "ml"], + 78 : ["Maltese", "mt"], + 79 : ["Maori", "mi"], + 80 : ["Marathi", "mr"], + 81 : ["Marshallese", "mh"], + 82 : ["Mongolian", "mn"], # macrolanguage + 83 : ["Nauru", "na"], + 84 : ["Nepali", "ne"], # macrolanguage + 85 : ["Norwegian Bokmal", "nb"], + 86 : ["Occitan", "oc"], + 87 : ["Oriya", "or"], # macrolanguage + 88 : ["Pashto", "ps"], # macrolanguage + 89 : ["Persian", "fa"], # macrolanguage + 90 : ["Polish", "pl"], + 91 : ["Portuguese", "pt"], + 92 : ["Punjabi", "pa"], + 93 : ["Quechua", "qu"], # macrolanguage + 94 : ["Romansh", "rm"], + 95 : ["Romanian", "ro"], + 96 : ["Russian", "ru"], + 97 : ["Samoan", "sm"], + 98 : ["Sango", "sg"], + 99 : ["Sanskrit", "sa"], + 100 : ["Serbian", "sr"], + 101 : ["Ossetic", "os"], + 102 : ["Southern Sotho", "st"], + 103 : ["Tswana", "tn"], + 104 : ["Shona", "sn"], + 105 : ["Sindhi", "sd"], + 106 : ["Sinhala", "si"], + 107 : ["Swati", "ss"], + 108 : ["Slovak", "sk"], + 109 : ["Slovenian", "sl"], + 110 : ["Somali", "so"], + 111 : ["Spanish", "es"], + 112 : ["Sundanese", "su"], + 113 : ["Swahili", "sw"], # macrolanguage + 114 : ["Swedish", "sv"], + 115 : ["Sardinian", "sc"], # macrolanguage + 116 : ["Tajik", "tg"], + 117 : ["Tamil", "ta"], + 118 : ["Tatar", "tt"], + 119 : ["Telugu", "te"], + 120 : ["Thai", "th"], + 121 : ["Tibetan", "bo"], + 122 : ["Tigrinya", "ti"], + 123 : ["Tongan", "to"], + 124 : ["Tsonga", "ts"], + 125 : ["Turkish", "tr"], + 126 : ["Turkmen", "tk"], + 127 : ["Tahitian", "ty"], + 128 : ["Uighur", "ug"], + 129 : ["Ukrainian", "uk"], + 130 : ["Urdu", "ur"], + 131 : ["Uzbek", "uz"], # macrolanguage + 132 : ["Vietnamese", "vi"], + 133 : ["Volapuk", "vo"], + 134 : ["Welsh", "cy"], + 135 : ["Wolof", "wo"], + 136 : ["Xhosa", "xh"], + 137 : ["Yiddish", "yi"], # macrolanguage + 138 : ["Yoruba", "yo"], + 139 : ["Zhuang", "za"], # macrolanguage + 140 : ["Zulu", "zu"], + 141 : ["Norwegian Nynorsk", "nn"], + 142 : ["Bosnian", "bs"], + 143 : ["Divehi", "dv"], + 144 : ["Manx", "gv"], + 145 : ["Cornish", "kw"], + 146 : ["Akan", "ak"], # macrolanguage + 147 : ["Konkani", "kok"], + 148 : ["Ga", "gaa"], + 149 : ["Igbo", "ig" ], + 150 : ["Kamba", "kam"], + 151 : ["Syriac", "syr"], + 152 : ["Blin", "byn"], + 153 : ["Geez", "gez"], + 154 : ["Koro", "kfo"], + 155 : ["Sidamo", "sid"], + 156 : ["Atsam", "cch"], + 157 : ["Tigre", "tig"], + 158 : ["Jju", "kaj"], + 159 : ["Friulian", "fur"], + 160 : ["Venda", "ve" ], + 161 : ["Ewe", "ee" ], + 162 : ["Walamo", "wal"], + 163 : ["Hawaiian", "haw"], + 164 : ["Tyap", "kcg"], + 165 : ["Nyanja", "ny" ], + 166 : ["Filipino", "fil"], + 167 : ["Swiss German", "gsw"], + 168 : ["Sichuan Yi", "ii" ], + 169 : ["Kpelle", "kpe"], + 170 : ["Low German", "nds"], + 171 : ["South Ndebele", "nr" ], + 172 : ["Northern Sotho", "nso"], + 173 : ["Northern Sami", "se" ], + 174 : ["Taroko", "trv"], + 175 : ["Gusii", "guz"], + 176 : ["Taita", "dav"], + 177 : ["Fulah", "ff"], # macrolanguage + 178 : ["Kikuyu", "ki"], + 179 : ["Samburu", "saq"], + 180 : ["Sena", "seh"], + 181 : ["North Ndebele", "nd"], + 182 : ["Rombo", "rof"], + 183 : ["Tachelhit", "shi"], + 184 : ["Kabyle", "kab"], + 185 : ["Nyankole", "nyn"], + 186 : ["Bena", "bez"], + 187 : ["Vunjo", "vun"], + 188 : ["Bambara", "bm"], + 189 : ["Embu", "ebu"], + 190 : ["Cherokee", "chr"], + 191 : ["Morisyen", "mfe"], + 192 : ["Makonde", "kde"], + 193 : ["Langi", "lag"], + 194 : ["Ganda", "lg"], + 195 : ["Bemba", "bem"], + 196 : ["Kabuverdianu", "kea"], + 197 : ["Meru", "mer"], + 198 : ["Kalenjin", "kln"], + 199 : ["Nama", "naq"], + 200 : ["Machame", "jmc"], + 201 : ["Colognian", "ksh"], + 202 : ["Masai", "mas"], + 203 : ["Soga", "xog"], + 204 : ["Luyia", "luy"], + 205 : ["Asu", "asa"], + 206 : ["Teso", "teo"], + 207 : ["Saho", "ssy"], + 208 : ["Koyra Chiini", "khq"], + 209 : ["Rwa", "rwk"], + 210 : ["Luo", "luo"], + 211 : ["Chiga", "cgg"], + 212 : ["Central Morocco Tamazight", "tzm"], + 213 : ["Koyraboro Senni", "ses"], + 214 : ["Shambala", "ksb"], + 215 : ["Bodo", "brx"], + 216 : ["Avaric", "av"], + 217 : ["Chamorro", "ch"], + 218 : ["Chechen", "ce"], + 219 : ["Church", "cu"], # macrolanguage + 220 : ["Chuvash", "cv"], + 221 : ["Cree", "cr"], # macrolanguage + 222 : ["Haitian", "ht"], + 223 : ["Herero", "hz"], + 224 : ["Hiri Motu", "ho"], + 225 : ["Kanuri", "kr"], # macrolanguage + 226 : ["Komi", "kv"], # macrolanguage + 227 : ["Kongo", "kg"], # macrolanguage + 228 : ["Kwanyama", "kj"], + 229 : ["Limburgish", "li"], + 230 : ["Luba Katanga", "lu"], + 231 : ["Luxembourgish", "lb"], + 232 : ["Navaho", "nv"], + 233 : ["Ndonga", "ng"], + 234 : ["Ojibwa", "oj"], # macrolanguage + 235 : ["Pali", "pi"], # macrolanguage + 236 : ["Walloon", "wa"], + 237 : ["Aghem", "agq"], + 238 : ["Basaa", "bas"], + 239 : ["Zarma", "dje"], + 240 : ["Duala", "dua"], + 241 : ["Jola Fonyi", "dyo"], + 242 : ["Ewondo", "ewo"], + 243 : ["Bafia", "ksf"], + 244 : ["Makhuwa Meetto", "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"], + 255 : ["Avestan", "ae"], + 256 : ["Asturian", "ast"], + 257 : ["Ngomba", "jgo"], + 258 : ["Kako", "kkj"], + 259 : ["Meta", "mgo"], + 260 : ["Ngiemboon", "nnh"], + 261 : ["Aragonese", "an"], + 262 : ["Akkadian", "akk"], + 263 : ["Ancient Egyptian", "egy"], + 264 : ["Ancient Greek", "grc"], + 265 : ["Aramaic", "arc"], + 266 : ["Balinese", "ban"], + 267 : ["Bamun", "bax"], + 268 : ["Batak Toba", "bbc"], + 269 : ["Buginese", "bug"], + 270 : ["Buhid", "bku"], + 271 : ["Carian", "xcr"], + 272 : ["Chakma", "ccp"], + 273 : ["Classical Mandaic", "myz"], + 274 : ["Coptic", "cop"], + 275 : ["Dogri", "doi"], # macrolanguage + 276 : ["Eastern Cham", "cjm"], + 277 : ["Eastern Kayah", "eky"], + 278 : ["Etruscan", "ett"], + 279 : ["Gothic", "got"], + 280 : ["Hanunoo", "hnn"], + 281 : ["Ingush", "inh"], + 282 : ["Large Flowery Miao", "hmd"], + 283 : ["Lepcha", "lep"], + 284 : ["Limbu", "lif"], + 285 : ["Lisu", "lis"], + 286 : ["Lu", "khb"], + 287 : ["Lycian", "xlc"], + 288 : ["Lydian", "xld"], + 289 : ["Mandingo", "man"], # macrolanguage + 290 : ["Manipuri", "mni"], + 291 : ["Meroitic", "xmr"], + 292 : ["Northern Thai", "nod"], + 293 : ["Old Irish", "sga"], + 294 : ["Old Norse", "non"], + 295 : ["Old Persian", "peo"], + 296 : ["Old Turkish", "otk"], + 297 : ["Pahlavi", "pal"], + 298 : ["Parthian", "xpr"], + 299 : ["Phoenician", "phn"], + 300 : ["Prakrit Language", "pra"], + 301 : ["Rejang", "rej"], + 302 : ["Sabaean", "xsa"], + 303 : ["Samaritan", "smp"], + 304 : ["Santali", "sat"], + 305 : ["Saurashtra", "saz"], + 306 : ["Sora", "srb"], + 307 : ["Sylheti", "syl"], + 308 : ["Tagbanwa", "tbw"], + 309 : ["Tai Dam", "blt"], + 310 : ["Tai Nua", "tdd"], + 311 : ["Ugaritic", "uga"], + 312 : ["Akoose", "bss"], + 313 : ["Lakota", "lkt"], + 314 : ["Standard Moroccan Tamazight", "zgh"], + 315 : ["Mapuche", "arn"], + 316 : ["Central Kurdish", "ckb"], + 317 : ["Lower Sorbian", "dsb"], + 318 : ["Upper Sorbian", "hsb"], + 319 : ["Kenyang", "ken"], + 320 : ["Mohawk", "moh"], + 321 : ["Nko", "nqo"], + 322 : ["Prussian", "prg"], + 323 : ["Kiche", "quc"], + 324 : ["Southern Sami", "sma"], + 325 : ["Lule Sami", "smj"], + 326 : ["Inari Sami", "smn"], + 327 : ["Skolt Sami", "sms"], + 328 : ["Warlpiri", "wbp"], + 329 : ["Manichaean Middle Persian", "xmn"], + 330 : ["Mende", "men"], + 331 : ["Ancient North Arabian", "xna"], + 332 : ["Linear A", "lab"], + 333 : ["Hmong Njua", "hnj"], + 334 : ["Ho", "hoc"], + 335 : ["Lezghian", "lez"], + 336 : ["Bassa", "bsq"], + 337 : ["Mono", "mru"], + 338 : ["Tedim Chin", "ctd"], + 339 : ["Maithili", "mai"], + 340 : ["Ahom", "aho"], + 341 : ["American Sign Language", "ase"], + 342 : ["Ardhamagadhi Prakrit", "pka"], + 343 : ["Bhojpuri", "bho"], + 344 : ["Hieroglyphic Luwian", "hlu"], + 345 : ["Literary Chinese", "lzh"], + 346 : ["Mazanderani", "mzn"], + 347 : ["Mru", "mro"], + 348 : ["Newari", "new"], + 349 : ["Northern Luri", "lrc"], + 350 : ["Palauan", "pau"], + 351 : ["Papiamento", "pap"], + 352 : ["Saraiki", "skr"], + 353 : ["Tokelau", "tkl"], + 354 : ["Tok Pisin", "tpi"], + 355 : ["Tuvalu", "tvl"], + 356 : ["Uncoded Languages", "mis"], + 357 : ["Cantonese", "yue"], + 358 : ["Osage", "osa"], + 359 : ["Tangut", "txg"] +} + +language_aliases = { + # Legacy - should disappear at some point: + 'Norwegian': 'NorwegianBokmal', + 'Moldavian': 'Romanian', + 'SerboCroatian': 'Serbian', + 'Tagalog': 'Filipino', + 'Twi': 'Akan', + # Renamings: + 'Afan': 'Oromo', + 'Byelorussian': 'Belarusian', + 'Bhutani': 'Dzongkha', + 'Cambodian': 'Khmer', + 'Kurundi': 'Rundi', + 'RhaetoRomance': 'Romansh', + 'Chewa': 'Nyanja', + 'Frisian': 'WesternFrisian', + 'Uigur': 'Uighur', } country_list = { - 0 : [ "AnyCountry", "ZZ" ], - 1 : [ "Afghanistan", "AF" ], - 2 : [ "Albania", "AL" ], - 3 : [ "Algeria", "DZ" ], - 4 : [ "AmericanSamoa", "AS" ], - 5 : [ "Andorra", "AD" ], - 6 : [ "Angola", "AO" ], - 7 : [ "Anguilla", "AI" ], - 8 : [ "Antarctica", "AQ" ], - 9 : [ "AntiguaAndBarbuda", "AG" ], - 10 : [ "Argentina", "AR" ], - 11 : [ "Armenia", "AM" ], - 12 : [ "Aruba", "AW" ], - 13 : [ "Australia", "AU" ], - 14 : [ "Austria", "AT" ], - 15 : [ "Azerbaijan", "AZ" ], - 16 : [ "Bahamas", "BS" ], - 17 : [ "Bahrain", "BH" ], - 18 : [ "Bangladesh", "BD" ], - 19 : [ "Barbados", "BB" ], - 20 : [ "Belarus", "BY" ], - 21 : [ "Belgium", "BE" ], - 22 : [ "Belize", "BZ" ], - 23 : [ "Benin", "BJ" ], - 24 : [ "Bermuda", "BM" ], - 25 : [ "Bhutan", "BT" ], - 26 : [ "Bolivia", "BO" ], - 27 : [ "BosniaAndHerzegowina", "BA" ], - 28 : [ "Botswana", "BW" ], - 29 : [ "BouvetIsland", "BV" ], - 30 : [ "Brazil", "BR" ], - 31 : [ "BritishIndianOceanTerritory", "IO" ], - 32 : [ "Brunei", "BN" ], - 33 : [ "Bulgaria", "BG" ], - 34 : [ "BurkinaFaso", "BF" ], - 35 : [ "Burundi", "BI" ], - 36 : [ "Cambodia", "KH" ], - 37 : [ "Cameroon", "CM" ], - 38 : [ "Canada", "CA" ], - 39 : [ "CapeVerde", "CV" ], - 40 : [ "CaymanIslands", "KY" ], - 41 : [ "CentralAfricanRepublic", "CF" ], - 42 : [ "Chad", "TD" ], - 43 : [ "Chile", "CL" ], - 44 : [ "China", "CN" ], - 45 : [ "ChristmasIsland", "CX" ], - 46 : [ "CocosIslands", "CC" ], - 47 : [ "Colombia", "CO" ], - 48 : [ "Comoros", "KM" ], - 49 : [ "CongoKinshasa", "CD" ], - 50 : [ "CongoBrazzaville", "CG" ], - 51 : [ "CookIslands", "CK" ], - 52 : [ "CostaRica", "CR" ], - 53 : [ "IvoryCoast", "CI" ], - 54 : [ "Croatia", "HR" ], - 55 : [ "Cuba", "CU" ], - 56 : [ "Cyprus", "CY" ], - 57 : [ "CzechRepublic", "CZ" ], - 58 : [ "Denmark", "DK" ], - 59 : [ "Djibouti", "DJ" ], - 60 : [ "Dominica", "DM" ], - 61 : [ "DominicanRepublic", "DO" ], - 62 : [ "EastTimor", "TL" ], - 63 : [ "Ecuador", "EC" ], - 64 : [ "Egypt", "EG" ], - 65 : [ "ElSalvador", "SV" ], - 66 : [ "EquatorialGuinea", "GQ" ], - 67 : [ "Eritrea", "ER" ], - 68 : [ "Estonia", "EE" ], - 69 : [ "Ethiopia", "ET" ], - 70 : [ "FalklandIslands", "FK" ], - 71 : [ "FaroeIslands", "FO" ], - 72 : [ "Fiji", "FJ" ], - 73 : [ "Finland", "FI" ], - 74 : [ "France", "FR" ], - 75 : [ "Guernsey", "GG" ], - 76 : [ "FrenchGuiana", "GF" ], - 77 : [ "FrenchPolynesia", "PF" ], - 78 : [ "FrenchSouthernTerritories", "TF" ], - 79 : [ "Gabon", "GA" ], - 80 : [ "Gambia", "GM" ], - 81 : [ "Georgia", "GE" ], - 82 : [ "Germany", "DE" ], - 83 : [ "Ghana", "GH" ], - 84 : [ "Gibraltar", "GI" ], - 85 : [ "Greece", "GR" ], - 86 : [ "Greenland", "GL" ], - 87 : [ "Grenada", "GD" ], - 88 : [ "Guadeloupe", "GP" ], - 89 : [ "Guam", "GU" ], - 90 : [ "Guatemala", "GT" ], - 91 : [ "Guinea", "GN" ], - 92 : [ "GuineaBissau", "GW" ], - 93 : [ "Guyana", "GY" ], - 94 : [ "Haiti", "HT" ], - 95 : [ "HeardAndMcDonaldIslands", "HM" ], - 96 : [ "Honduras", "HN" ], - 97 : [ "HongKong", "HK" ], - 98 : [ "Hungary", "HU" ], - 99 : [ "Iceland", "IS" ], - 100 : [ "India", "IN" ], - 101 : [ "Indonesia", "ID" ], - 102 : [ "Iran", "IR" ], - 103 : [ "Iraq", "IQ" ], - 104 : [ "Ireland", "IE" ], - 105 : [ "Israel", "IL" ], - 106 : [ "Italy", "IT" ], - 107 : [ "Jamaica", "JM" ], - 108 : [ "Japan", "JP" ], - 109 : [ "Jordan", "JO" ], - 110 : [ "Kazakhstan", "KZ" ], - 111 : [ "Kenya", "KE" ], - 112 : [ "Kiribati", "KI" ], - 113 : [ "NorthKorea", "KP" ], - 114 : [ "SouthKorea", "KR" ], - 115 : [ "Kuwait", "KW" ], - 116 : [ "Kyrgyzstan", "KG" ], - 117 : [ "Laos", "LA" ], - 118 : [ "Latvia", "LV" ], - 119 : [ "Lebanon", "LB" ], - 120 : [ "Lesotho", "LS" ], - 121 : [ "Liberia", "LR" ], - 122 : [ "Libya", "LY" ], - 123 : [ "Liechtenstein", "LI" ], - 124 : [ "Lithuania", "LT" ], - 125 : [ "Luxembourg", "LU" ], - 126 : [ "Macau", "MO" ], - 127 : [ "Macedonia", "MK" ], - 128 : [ "Madagascar", "MG" ], - 129 : [ "Malawi", "MW" ], - 130 : [ "Malaysia", "MY" ], - 131 : [ "Maldives", "MV" ], - 132 : [ "Mali", "ML" ], - 133 : [ "Malta", "MT" ], - 134 : [ "MarshallIslands", "MH" ], - 135 : [ "Martinique", "MQ" ], - 136 : [ "Mauritania", "MR" ], - 137 : [ "Mauritius", "MU" ], - 138 : [ "Mayotte", "YT" ], - 139 : [ "Mexico", "MX" ], - 140 : [ "Micronesia", "FM" ], - 141 : [ "Moldova", "MD" ], - 142 : [ "Monaco", "MC" ], - 143 : [ "Mongolia", "MN" ], - 144 : [ "Montserrat", "MS" ], - 145 : [ "Morocco", "MA" ], - 146 : [ "Mozambique", "MZ" ], - 147 : [ "Myanmar", "MM" ], - 148 : [ "Namibia", "NA" ], - 149 : [ "Nauru", "NR" ], - 150 : [ "Nepal", "NP" ], - 151 : [ "Netherlands", "NL" ], - 152 : [ "CuraSao", "CW" ], - 153 : [ "NewCaledonia", "NC" ], - 154 : [ "NewZealand", "NZ" ], - 155 : [ "Nicaragua", "NI" ], - 156 : [ "Niger", "NE" ], - 157 : [ "Nigeria", "NG" ], - 158 : [ "Niue", "NU" ], - 159 : [ "NorfolkIsland", "NF" ], - 160 : [ "NorthernMarianaIslands", "MP" ], - 161 : [ "Norway", "NO" ], - 162 : [ "Oman", "OM" ], - 163 : [ "Pakistan", "PK" ], - 164 : [ "Palau", "PW" ], - 165 : [ "PalestinianTerritories", "PS" ], - 166 : [ "Panama", "PA" ], - 167 : [ "PapuaNewGuinea", "PG" ], - 168 : [ "Paraguay", "PY" ], - 169 : [ "Peru", "PE" ], - 170 : [ "Philippines", "PH" ], - 171 : [ "Pitcairn", "PN" ], - 172 : [ "Poland", "PL" ], - 173 : [ "Portugal", "PT" ], - 174 : [ "PuertoRico", "PR" ], - 175 : [ "Qatar", "QA" ], - 176 : [ "Reunion", "RE" ], - 177 : [ "Romania", "RO" ], - 178 : [ "Russia", "RU" ], - 179 : [ "Rwanda", "RW" ], - 180 : [ "SaintKittsAndNevis", "KN" ], - 181 : [ "SaintLucia", "LC" ], - 182 : [ "SaintVincentAndTheGrenadines", "VC" ], - 183 : [ "Samoa", "WS" ], - 184 : [ "SanMarino", "SM" ], - 185 : [ "SaoTomeAndPrincipe", "ST" ], - 186 : [ "SaudiArabia", "SA" ], - 187 : [ "Senegal", "SN" ], - 188 : [ "Seychelles", "SC" ], - 189 : [ "SierraLeone", "SL" ], - 190 : [ "Singapore", "SG" ], - 191 : [ "Slovakia", "SK" ], - 192 : [ "Slovenia", "SI" ], - 193 : [ "SolomonIslands", "SB" ], - 194 : [ "Somalia", "SO" ], - 195 : [ "SouthAfrica", "ZA" ], - 196 : [ "SouthGeorgiaAndTheSouthSandwichIslands", "GS" ], - 197 : [ "Spain", "ES" ], - 198 : [ "SriLanka", "LK" ], - 199 : [ "SaintHelena", "SH" ], - 200 : [ "SaintPierreAndMiquelon", "PM" ], - 201 : [ "Sudan", "SD" ], - 202 : [ "Suriname", "SR" ], - 203 : [ "SvalbardAndJanMayenIslands", "SJ" ], - 204 : [ "Swaziland", "SZ" ], - 205 : [ "Sweden", "SE" ], - 206 : [ "Switzerland", "CH" ], - 207 : [ "Syria", "SY" ], - 208 : [ "Taiwan", "TW" ], - 209 : [ "Tajikistan", "TJ" ], - 210 : [ "Tanzania", "TZ" ], - 211 : [ "Thailand", "TH" ], - 212 : [ "Togo", "TG" ], - 213 : [ "Tokelau", "TK" ], - 214 : [ "Tonga", "TO" ], - 215 : [ "TrinidadAndTobago", "TT" ], - 216 : [ "Tunisia", "TN" ], - 217 : [ "Turkey", "TR" ], - 218 : [ "Turkmenistan", "TM" ], - 219 : [ "TurksAndCaicosIslands", "TC" ], - 220 : [ "Tuvalu", "TV" ], - 221 : [ "Uganda", "UG" ], - 222 : [ "Ukraine", "UA" ], - 223 : [ "UnitedArabEmirates", "AE" ], - 224 : [ "UnitedKingdom", "GB" ], - 225 : [ "UnitedStates", "US" ], - 226 : [ "UnitedStatesMinorOutlyingIslands", "UM" ], - 227 : [ "Uruguay", "UY" ], - 228 : [ "Uzbekistan", "UZ" ], - 229 : [ "Vanuatu", "VU" ], - 230 : [ "VaticanCityState", "VA" ], - 231 : [ "Venezuela", "VE" ], - 232 : [ "Vietnam", "VN" ], - 233 : [ "BritishVirginIslands", "VG" ], - 234 : [ "UnitedStatesVirginIslands", "VI" ], - 235 : [ "WallisAndFutunaIslands", "WF" ], - 236 : [ "WesternSahara", "EH" ], - 237 : [ "Yemen", "YE" ], - 238 : [ "CanaryIslands", "IC" ], - 239 : [ "Zambia", "ZM" ], - 240 : [ "Zimbabwe", "ZW" ], - 241 : [ "ClippertonIsland", "CP" ], - 242 : [ "Montenegro", "ME" ], - 243 : [ "Serbia", "RS" ], - 244 : [ "Saint Barthelemy", "BL" ], - 245 : [ "Saint Martin", "MF" ], - 246 : [ "LatinAmericaAndTheCaribbean", "419" ], - 247 : [ "AscensionIsland", "AC" ], - 248 : [ "AlandIslands", "AX" ], - 249 : [ "DiegoGarcia", "DG" ], - 250 : [ "CeutaAndMelilla", "EA" ], - 251 : [ "IsleOfMan", "IM" ], - 252 : [ "Jersey", "JE" ], - 253 : [ "TristanDaCunha", "TA" ], - 254 : [ "SouthSudan", "SS" ], - 255 : [ "Bonaire", "BQ" ], - 256 : [ "SintMaarten", "SX" ], - 257 : [ "Kosovo", "XK" ], - 258 : [ "European Union", "EU" ], - 259 : [ "Outlying Oceania", "QO" ] + 0 : ["AnyCountry", "ZZ"], + 1 : ["Afghanistan", "AF"], + 2 : ["Albania", "AL"], + 3 : ["Algeria", "DZ"], + 4 : ["American Samoa", "AS"], + 5 : ["Andorra", "AD"], + 6 : ["Angola", "AO"], + 7 : ["Anguilla", "AI"], + 8 : ["Antarctica", "AQ"], + 9 : ["Antigua And Barbuda", "AG"], + 10 : ["Argentina", "AR"], + 11 : ["Armenia", "AM"], + 12 : ["Aruba", "AW"], + 13 : ["Australia", "AU"], + 14 : ["Austria", "AT"], + 15 : ["Azerbaijan", "AZ"], + 16 : ["Bahamas", "BS"], + 17 : ["Bahrain", "BH"], + 18 : ["Bangladesh", "BD"], + 19 : ["Barbados", "BB"], + 20 : ["Belarus", "BY"], + 21 : ["Belgium", "BE"], + 22 : ["Belize", "BZ"], + 23 : ["Benin", "BJ"], + 24 : ["Bermuda", "BM"], + 25 : ["Bhutan", "BT"], + 26 : ["Bolivia", "BO"], + 27 : ["Bosnia And Herzegowina", "BA"], + 28 : ["Botswana", "BW"], + 29 : ["Bouvet Island", "BV"], + 30 : ["Brazil", "BR"], + 31 : ["British Indian Ocean Territory", "IO"], + 32 : ["Brunei", "BN"], + 33 : ["Bulgaria", "BG"], + 34 : ["Burkina Faso", "BF"], + 35 : ["Burundi", "BI"], + 36 : ["Cambodia", "KH"], + 37 : ["Cameroon", "CM"], + 38 : ["Canada", "CA"], + 39 : ["Cape Verde", "CV"], + 40 : ["Cayman Islands", "KY"], + 41 : ["Central African Republic", "CF"], + 42 : ["Chad", "TD"], + 43 : ["Chile", "CL"], + 44 : ["China", "CN"], + 45 : ["Christmas Island", "CX"], + 46 : ["Cocos Islands", "CC"], + 47 : ["Colombia", "CO"], + 48 : ["Comoros", "KM"], + 49 : ["Congo Kinshasa", "CD"], + 50 : ["Congo Brazzaville", "CG"], + 51 : ["Cook Islands", "CK"], + 52 : ["Costa Rica", "CR"], + 53 : ["Ivory Coast", "CI"], + 54 : ["Croatia", "HR"], + 55 : ["Cuba", "CU"], + 56 : ["Cyprus", "CY"], + 57 : ["Czech Republic", "CZ"], + 58 : ["Denmark", "DK"], + 59 : ["Djibouti", "DJ"], + 60 : ["Dominica", "DM"], + 61 : ["Dominican Republic", "DO"], + 62 : ["East Timor", "TL"], + 63 : ["Ecuador", "EC"], + 64 : ["Egypt", "EG"], + 65 : ["El Salvador", "SV"], + 66 : ["Equatorial Guinea", "GQ"], + 67 : ["Eritrea", "ER"], + 68 : ["Estonia", "EE"], + 69 : ["Ethiopia", "ET"], + 70 : ["Falkland Islands", "FK"], + 71 : ["Faroe Islands", "FO"], + 72 : ["Fiji", "FJ"], + 73 : ["Finland", "FI"], + 74 : ["France", "FR"], + 75 : ["Guernsey", "GG"], + 76 : ["French Guiana", "GF"], + 77 : ["French Polynesia", "PF"], + 78 : ["French Southern Territories", "TF"], + 79 : ["Gabon", "GA"], + 80 : ["Gambia", "GM"], + 81 : ["Georgia", "GE"], + 82 : ["Germany", "DE"], + 83 : ["Ghana", "GH"], + 84 : ["Gibraltar", "GI"], + 85 : ["Greece", "GR"], + 86 : ["Greenland", "GL"], + 87 : ["Grenada", "GD"], + 88 : ["Guadeloupe", "GP"], + 89 : ["Guam", "GU"], + 90 : ["Guatemala", "GT"], + 91 : ["Guinea", "GN"], + 92 : ["Guinea Bissau", "GW"], + 93 : ["Guyana", "GY"], + 94 : ["Haiti", "HT"], + 95 : ["Heard And McDonald Islands", "HM"], + 96 : ["Honduras", "HN"], + 97 : ["Hong Kong", "HK"], + 98 : ["Hungary", "HU"], + 99 : ["Iceland", "IS"], + 100 : ["India", "IN"], + 101 : ["Indonesia", "ID"], + 102 : ["Iran", "IR"], + 103 : ["Iraq", "IQ"], + 104 : ["Ireland", "IE"], + 105 : ["Israel", "IL"], + 106 : ["Italy", "IT"], + 107 : ["Jamaica", "JM"], + 108 : ["Japan", "JP"], + 109 : ["Jordan", "JO"], + 110 : ["Kazakhstan", "KZ"], + 111 : ["Kenya", "KE"], + 112 : ["Kiribati", "KI"], + 113 : ["North Korea", "KP"], + 114 : ["South Korea", "KR"], + 115 : ["Kuwait", "KW"], + 116 : ["Kyrgyzstan", "KG"], + 117 : ["Laos", "LA"], + 118 : ["Latvia", "LV"], + 119 : ["Lebanon", "LB"], + 120 : ["Lesotho", "LS"], + 121 : ["Liberia", "LR"], + 122 : ["Libya", "LY"], + 123 : ["Liechtenstein", "LI"], + 124 : ["Lithuania", "LT"], + 125 : ["Luxembourg", "LU"], + 126 : ["Macau", "MO"], + 127 : ["Macedonia", "MK"], + 128 : ["Madagascar", "MG"], + 129 : ["Malawi", "MW"], + 130 : ["Malaysia", "MY"], + 131 : ["Maldives", "MV"], + 132 : ["Mali", "ML"], + 133 : ["Malta", "MT"], + 134 : ["Marshall Islands", "MH"], + 135 : ["Martinique", "MQ"], + 136 : ["Mauritania", "MR"], + 137 : ["Mauritius", "MU"], + 138 : ["Mayotte", "YT"], + 139 : ["Mexico", "MX"], + 140 : ["Micronesia", "FM"], + 141 : ["Moldova", "MD"], + 142 : ["Monaco", "MC"], + 143 : ["Mongolia", "MN"], + 144 : ["Montserrat", "MS"], + 145 : ["Morocco", "MA"], + 146 : ["Mozambique", "MZ"], + 147 : ["Myanmar", "MM"], + 148 : ["Namibia", "NA"], + 149 : ["Nauru", "NR"], + 150 : ["Nepal", "NP"], + 151 : ["Netherlands", "NL"], + 152 : ["Cura Sao", "CW"], + 153 : ["New Caledonia", "NC"], + 154 : ["New Zealand", "NZ"], + 155 : ["Nicaragua", "NI"], + 156 : ["Niger", "NE"], + 157 : ["Nigeria", "NG"], + 158 : ["Niue", "NU"], + 159 : ["Norfolk Island", "NF"], + 160 : ["Northern Mariana Islands", "MP"], + 161 : ["Norway", "NO"], + 162 : ["Oman", "OM"], + 163 : ["Pakistan", "PK"], + 164 : ["Palau", "PW"], + 165 : ["Palestinian Territories", "PS"], + 166 : ["Panama", "PA"], + 167 : ["Papua New Guinea", "PG"], + 168 : ["Paraguay", "PY"], + 169 : ["Peru", "PE"], + 170 : ["Philippines", "PH"], + 171 : ["Pitcairn", "PN"], + 172 : ["Poland", "PL"], + 173 : ["Portugal", "PT"], + 174 : ["Puerto Rico", "PR"], + 175 : ["Qatar", "QA"], + 176 : ["Reunion", "RE"], + 177 : ["Romania", "RO"], + 178 : ["Russia", "RU"], + 179 : ["Rwanda", "RW"], + 180 : ["Saint Kitts And Nevis", "KN"], + 181 : ["Saint Lucia", "LC"], + 182 : ["Saint Vincent And The Grenadines", "VC"], + 183 : ["Samoa", "WS"], + 184 : ["San Marino", "SM"], + 185 : ["Sao Tome And Principe", "ST"], + 186 : ["Saudi Arabia", "SA"], + 187 : ["Senegal", "SN"], + 188 : ["Seychelles", "SC"], + 189 : ["Sierra Leone", "SL"], + 190 : ["Singapore", "SG"], + 191 : ["Slovakia", "SK"], + 192 : ["Slovenia", "SI"], + 193 : ["Solomon Islands", "SB"], + 194 : ["Somalia", "SO"], + 195 : ["South Africa", "ZA"], + 196 : ["South Georgia And The South Sandwich Islands", "GS"], + 197 : ["Spain", "ES"], + 198 : ["Sri Lanka", "LK"], + 199 : ["Saint Helena", "SH"], + 200 : ["Saint Pierre And Miquelon", "PM"], + 201 : ["Sudan", "SD"], + 202 : ["Suriname", "SR"], + 203 : ["Svalbard And Jan Mayen Islands", "SJ"], + 204 : ["Swaziland", "SZ"], + 205 : ["Sweden", "SE"], + 206 : ["Switzerland", "CH"], + 207 : ["Syria", "SY"], + 208 : ["Taiwan", "TW"], + 209 : ["Tajikistan", "TJ"], + 210 : ["Tanzania", "TZ"], + 211 : ["Thailand", "TH"], + 212 : ["Togo", "TG"], + 213 : ["Tokelau", "TK"], + 214 : ["Tonga", "TO"], + 215 : ["Trinidad And Tobago", "TT"], + 216 : ["Tunisia", "TN"], + 217 : ["Turkey", "TR"], + 218 : ["Turkmenistan", "TM"], + 219 : ["Turks And Caicos Islands", "TC"], + 220 : ["Tuvalu", "TV"], + 221 : ["Uganda", "UG"], + 222 : ["Ukraine", "UA"], + 223 : ["United Arab Emirates", "AE"], + 224 : ["United Kingdom", "GB"], + 225 : ["United States", "US"], + 226 : ["United States Minor Outlying Islands", "UM"], + 227 : ["Uruguay", "UY"], + 228 : ["Uzbekistan", "UZ"], + 229 : ["Vanuatu", "VU"], + 230 : ["Vatican City State", "VA"], + 231 : ["Venezuela", "VE"], + 232 : ["Vietnam", "VN"], + 233 : ["British Virgin Islands", "VG"], + 234 : ["United States Virgin Islands", "VI"], + 235 : ["Wallis And Futuna Islands", "WF"], + 236 : ["Western Sahara", "EH"], + 237 : ["Yemen", "YE"], + 238 : ["Canary Islands", "IC"], + 239 : ["Zambia", "ZM"], + 240 : ["Zimbabwe", "ZW"], + 241 : ["Clipperton Island", "CP"], + 242 : ["Montenegro", "ME"], + 243 : ["Serbia", "RS"], + 244 : ["Saint Barthelemy", "BL"], + 245 : ["Saint Martin", "MF"], + 246 : ["Latin America", "419"], + 247 : ["Ascension Island", "AC"], + 248 : ["Aland Islands", "AX"], + 249 : ["Diego Garcia", "DG"], + 250 : ["Ceuta And Melilla", "EA"], + 251 : ["Isle Of Man", "IM"], + 252 : ["Jersey", "JE"], + 253 : ["Tristan Da Cunha", "TA"], + 254 : ["South Sudan", "SS"], + 255 : ["Bonaire", "BQ"], + 256 : ["Sint Maarten", "SX"], + 257 : ["Kosovo", "XK"], + 258 : ["European Union", "EU"], + 259 : ["Outlying Oceania", "QO"], + 260 : ["World", "001"], + 261 : ["Europe", "150"] +} + +country_aliases = { + # Deprecated: + 'Tokelau': 'TokelauCountry', + 'Tuvalu': 'TuvaluCountry', + # Renamings: + 'DemocraticRepublicOfCongo': 'CongoKinshasa', + 'PeoplesRepublicOfCongo': 'CongoBrazzaville', + 'DemocraticRepublicOfKorea': 'NorthKorea', + 'RepublicOfKorea': 'SouthKorea', + 'RussianFederation': 'Russia', + 'SyrianArabRepublic': 'Syria', + 'LatinAmericaAndTheCaribbean': 'LatinAmerica', } script_list = { - 0 : [ "AnyScript", "Zzzz" ], - 1 : [ "Arabic", "Arab" ], - 2 : [ "Cyrillic", "Cyrl" ], - 3 : [ "Deseret", "Dsrt" ], - 4 : [ "Gurmukhi", "Guru" ], - 5 : [ "Simplified Han", "Hans" ], - 6 : [ "Traditional Han", "Hant" ], - 7 : [ "Latin", "Latn" ], - 8 : [ "Mongolian", "Mong" ], - 9 : [ "Tifinagh", "Tfng" ], - 10 : [ "Armenian", "Armn" ], - 11 : [ "Bengali", "Beng" ], - 12 : [ "Cherokee", "Cher" ], - 13 : [ "Devanagari", "Deva" ], - 14 : [ "Ethiopic", "Ethi" ], - 15 : [ "Georgian", "Geor" ], - 16 : [ "Greek", "Grek" ], - 17 : [ "Gujarati", "Gujr" ], - 18 : [ "Hebrew", "Hebr" ], - 19 : [ "Japanese", "Jpan" ], - 20 : [ "Khmer", "Khmr" ], - 21 : [ "Kannada", "Knda" ], - 22 : [ "Korean", "Kore" ], - 23 : [ "Lao", "Laoo" ], - 24 : [ "Malayalam", "Mlym" ], - 25 : [ "Myanmar", "Mymr" ], - 26 : [ "Oriya", "Orya" ], - 27 : [ "Tamil", "Taml" ], - 28 : [ "Telugu", "Telu" ], - 29 : [ "Thaana", "Thaa" ], - 30 : [ "Thai", "Thai" ], - 31 : [ "Tibetan", "Tibt" ], - 32 : [ "Sinhala", "Sinh" ], - 33 : [ "Syriac", "Syrc" ], - 34 : [ "Yi", "Yiii" ], - 35 : [ "Vai", "Vaii" ], - 36 : [ "Avestan", "Avst" ], - 37 : [ "Balinese", "Bali" ], - 38 : [ "Bamum", "Bamu" ], - 39 : [ "Batak", "Batk" ], - 40 : [ "Bopomofo", "Bopo" ], - 41 : [ "Brahmi", "Brah" ], - 42 : [ "Buginese", "Bugi" ], - 43 : [ "Buhid", "Buhd" ], - 44 : [ "CanadianAboriginal", "Cans" ], - 45 : [ "Carian", "Cari" ], - 46 : [ "Chakma", "Cakm" ], - 47 : [ "Cham", "Cham" ], - 48 : [ "Coptic", "Copt" ], - 49 : [ "Cypriot", "Cprt" ], - 50 : [ "Egyptian Hieroglyphs", "Egyp" ], - 51 : [ "Fraser", "Lisu" ], - 52 : [ "Glagolitic", "Glag" ], - 53 : [ "Gothic", "Goth" ], - 54 : [ "Han", "Hani" ], - 55 : [ "Hangul", "Hang" ], - 56 : [ "Hanunoo", "Hano" ], - 57 : [ "Imperial Aramaic", "Armi" ], - 58 : [ "Inscriptional Pahlavi", "Phli" ], - 59 : [ "Inscriptional Parthian", "Prti" ], - 60 : [ "Javanese", "Java" ], - 61 : [ "Kaithi", "Kthi" ], - 62 : [ "Katakana", "Kana" ], - 63 : [ "Kayah Li", "Kali" ], - 64 : [ "Kharoshthi", "Khar" ], - 65 : [ "Lanna", "Lana" ], - 66 : [ "Lepcha", "Lepc" ], - 67 : [ "Limbu", "Limb" ], - 68 : [ "Linear B", "Linb" ], - 69 : [ "Lycian", "Lyci" ], - 70 : [ "Lydian", "Lydi" ], - 71 : [ "Mandaean", "Mand" ], - 72 : [ "Meitei Mayek", "Mtei" ], - 73 : [ "Meroitic", "Mero" ], - 74 : [ "Meroitic Cursive", "Merc" ], - 75 : [ "Nko", "Nkoo" ], - 76 : [ "New Tai Lue", "Talu" ], - 77 : [ "Ogham", "Ogam" ], - 78 : [ "Ol Chiki", "Olck" ], - 79 : [ "Old Italic", "Ital" ], - 80 : [ "Old Persian", "Xpeo" ], - 81 : [ "Old South Arabian", "Sarb" ], - 82 : [ "Orkhon", "Orkh" ], - 83 : [ "Osmanya", "Osma" ], - 84 : [ "Phags Pa", "Phag" ], - 85 : [ "Phoenician", "Phnx" ], - 86 : [ "Pollard Phonetic", "Plrd" ], - 87 : [ "Rejang", "Rjng" ], - 88 : [ "Runic", "Runr" ], - 89 : [ "Samaritan", "Samr" ], - 90 : [ "Saurashtra", "Saur" ], - 91 : [ "Sharada", "Shrd" ], - 92 : [ "Shavian", "Shaw" ], - 93 : [ "Sora Sompeng", "Sora" ], - 94 : [ "Cuneiform", "Xsux" ], - 95 : [ "Sundanese", "Sund" ], - 96 : [ "Syloti Nagri", "Sylo" ], - 97 : [ "Tagalog", "Tglg" ], - 98 : [ "Tagbanwa", "Tagb" ], - 99 : [ "Tai Le", "Tale" ], - 100 : [ "Tai Viet", "Tavt" ], - 101 : [ "Takri", "Takr" ], - 102 : [ "Ugaritic", "Ugar" ], - 103 : [ "Braille", "Brai" ], - 104 : [ "Hiragana", "Hira" ], - 105 : [ "Caucasian Albanian", "Aghb" ], - 106 : [ "Bassa Vah", "Bass" ], - 107 : [ "Duployan", "Dupl" ], - 108 : [ "Elbasan", "Elba" ], - 109 : [ "Grantha", "Gran" ], - 110 : [ "Pahawh Hmong", "Hmng" ], - 111 : [ "Khojki", "Khoj" ], - 112 : [ "Linear A", "Lina" ], - 113 : [ "Mahajani", "Mahj" ], - 114 : [ "Manichaean", "Mani" ], - 115 : [ "Mende Kikakui", "Mend" ], - 116 : [ "Modi", "Modi" ], - 117 : [ "Mro", "Mroo" ], - 118 : [ "Old North Arabian", "Narb" ], - 119 : [ "Nabataean", "Nbat" ], - 120 : [ "Palmyrene", "Palm" ], - 121 : [ "Pau Cin Hau", "Pauc" ], - 122 : [ "Old Permic", "Perm" ], - 123 : [ "Psalter Pahlavi", "Phlp" ], - 124 : [ "Siddham", "Sidd" ], - 125 : [ "Khudawadi", "Sind" ], - 126 : [ "Tirhuta", "Tirh" ], - 127 : [ "Varang Kshiti", "Wara" ], - 128 : [ "Ahom", "Ahom" ], - 129 : [ "Anatolian Hieroglyphs", "Hluw" ], - 130 : [ "Hatran", "Hatr" ], - 131 : [ "Multani", "Mult" ], - 132 : [ "Old Hungarian", "Hung" ], - 133 : [ "SignWriting", "Sgnw" ], - 134 : [ "Adlam", "Adlm" ], - 135 : [ "Bhaiksuki", "Bhks" ], - 136 : [ "Marchen", "Marc" ], - 137 : [ "Newa", "Newa" ], - 138 : [ "Osage", "Osge" ], - 139 : [ "Tangut", "Tang" ], - 140 : [ "Han with Bopomofo", "Hanb" ], - 141 : [ "Jamo", "Jamo" ] + 0 : ["AnyScript", "Zzzz"], + 1 : ["Arabic", "Arab"], + 2 : ["Cyrillic", "Cyrl"], + 3 : ["Deseret", "Dsrt"], + 4 : ["Gurmukhi", "Guru"], + 5 : ["Simplified Han", "Hans"], + 6 : ["Traditional Han", "Hant"], + 7 : ["Latin", "Latn"], + 8 : ["Mongolian", "Mong"], + 9 : ["Tifinagh", "Tfng"], + 10 : ["Armenian", "Armn"], + 11 : ["Bengali", "Beng"], + 12 : ["Cherokee", "Cher"], + 13 : ["Devanagari", "Deva"], + 14 : ["Ethiopic", "Ethi"], + 15 : ["Georgian", "Geor"], + 16 : ["Greek", "Grek"], + 17 : ["Gujarati", "Gujr"], + 18 : ["Hebrew", "Hebr"], + 19 : ["Japanese", "Jpan"], + 20 : ["Khmer", "Khmr"], + 21 : ["Kannada", "Knda"], + 22 : ["Korean", "Kore"], + 23 : ["Lao", "Laoo"], + 24 : ["Malayalam", "Mlym"], + 25 : ["Myanmar", "Mymr"], + 26 : ["Oriya", "Orya"], + 27 : ["Tamil", "Taml"], + 28 : ["Telugu", "Telu"], + 29 : ["Thaana", "Thaa"], + 30 : ["Thai", "Thai"], + 31 : ["Tibetan", "Tibt"], + 32 : ["Sinhala", "Sinh"], + 33 : ["Syriac", "Syrc"], + 34 : ["Yi", "Yiii"], + 35 : ["Vai", "Vaii"], + 36 : ["Avestan", "Avst"], + 37 : ["Balinese", "Bali"], + 38 : ["Bamum", "Bamu"], + 39 : ["Batak", "Batk"], + 40 : ["Bopomofo", "Bopo"], + 41 : ["Brahmi", "Brah"], + 42 : ["Buginese", "Bugi"], + 43 : ["Buhid", "Buhd"], + 44 : ["Canadian Aboriginal", "Cans"], + 45 : ["Carian", "Cari"], + 46 : ["Chakma", "Cakm"], + 47 : ["Cham", "Cham"], + 48 : ["Coptic", "Copt"], + 49 : ["Cypriot", "Cprt"], + 50 : ["Egyptian Hieroglyphs", "Egyp"], + 51 : ["Fraser", "Lisu"], + 52 : ["Glagolitic", "Glag"], + 53 : ["Gothic", "Goth"], + 54 : ["Han", "Hani"], + 55 : ["Hangul", "Hang"], + 56 : ["Hanunoo", "Hano"], + 57 : ["Imperial Aramaic", "Armi"], + 58 : ["Inscriptional Pahlavi", "Phli"], + 59 : ["Inscriptional Parthian", "Prti"], + 60 : ["Javanese", "Java"], + 61 : ["Kaithi", "Kthi"], + 62 : ["Katakana", "Kana"], + 63 : ["Kayah Li", "Kali"], + 64 : ["Kharoshthi", "Khar"], + 65 : ["Lanna", "Lana"], + 66 : ["Lepcha", "Lepc"], + 67 : ["Limbu", "Limb"], + 68 : ["Linear B", "Linb"], + 69 : ["Lycian", "Lyci"], + 70 : ["Lydian", "Lydi"], + 71 : ["Mandaean", "Mand"], + 72 : ["Meitei Mayek", "Mtei"], + 73 : ["Meroitic", "Mero"], + 74 : ["Meroitic Cursive", "Merc"], + 75 : ["Nko", "Nkoo"], + 76 : ["New Tai Lue", "Talu"], + 77 : ["Ogham", "Ogam"], + 78 : ["Ol Chiki", "Olck"], + 79 : ["Old Italic", "Ital"], + 80 : ["Old Persian", "Xpeo"], + 81 : ["Old South Arabian", "Sarb"], + 82 : ["Orkhon", "Orkh"], + 83 : ["Osmanya", "Osma"], + 84 : ["Phags Pa", "Phag"], + 85 : ["Phoenician", "Phnx"], + 86 : ["Pollard Phonetic", "Plrd"], + 87 : ["Rejang", "Rjng"], + 88 : ["Runic", "Runr"], + 89 : ["Samaritan", "Samr"], + 90 : ["Saurashtra", "Saur"], + 91 : ["Sharada", "Shrd"], + 92 : ["Shavian", "Shaw"], + 93 : ["Sora Sompeng", "Sora"], + 94 : ["Cuneiform", "Xsux"], + 95 : ["Sundanese", "Sund"], + 96 : ["Syloti Nagri", "Sylo"], + 97 : ["Tagalog", "Tglg"], + 98 : ["Tagbanwa", "Tagb"], + 99 : ["Tai Le", "Tale"], + 100 : ["Tai Viet", "Tavt"], + 101 : ["Takri", "Takr"], + 102 : ["Ugaritic", "Ugar"], + 103 : ["Braille", "Brai"], + 104 : ["Hiragana", "Hira"], + 105 : ["Caucasian Albanian", "Aghb"], + 106 : ["Bassa Vah", "Bass"], + 107 : ["Duployan", "Dupl"], + 108 : ["Elbasan", "Elba"], + 109 : ["Grantha", "Gran"], + 110 : ["Pahawh Hmong", "Hmng"], + 111 : ["Khojki", "Khoj"], + 112 : ["Linear A", "Lina"], + 113 : ["Mahajani", "Mahj"], + 114 : ["Manichaean", "Mani"], + 115 : ["Mende Kikakui", "Mend"], + 116 : ["Modi", "Modi"], + 117 : ["Mro", "Mroo"], + 118 : ["Old North Arabian", "Narb"], + 119 : ["Nabataean", "Nbat"], + 120 : ["Palmyrene", "Palm"], + 121 : ["Pau Cin Hau", "Pauc"], + 122 : ["Old Permic", "Perm"], + 123 : ["Psalter Pahlavi", "Phlp"], + 124 : ["Siddham", "Sidd"], + 125 : ["Khudawadi", "Sind"], + 126 : ["Tirhuta", "Tirh"], + 127 : ["Varang Kshiti", "Wara"], + 128 : ["Ahom", "Ahom"], + 129 : ["Anatolian Hieroglyphs", "Hluw"], + 130 : ["Hatran", "Hatr"], + 131 : ["Multani", "Mult"], + 132 : ["Old Hungarian", "Hung"], + 133 : ["Sign Writing", "Sgnw"], + 134 : ["Adlam", "Adlm"], + 135 : ["Bhaiksuki", "Bhks"], + 136 : ["Marchen", "Marc"], + 137 : ["Newa", "Newa"], + 138 : ["Osage", "Osge"], + 139 : ["Tangut", "Tang"], + 140 : ["Han with Bopomofo", "Hanb"], + 141 : ["Jamo", "Jamo"] +} + +script_aliases = { + # Renamings: + 'SimplifiedChineseScript': 'SimplifiedHanScript', + 'TraditionalChineseScript': 'TraditionalHanScript', } def countryCodeToId(code): diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py index 0f10f8ce2d..fb5ae5ba54 100755 --- a/util/local_database/qlocalexml2cpp.py +++ b/util/local_database/qlocalexml2cpp.py @@ -38,6 +38,7 @@ import sys import tempfile import datetime import xml.dom.minidom +from enumdata import language_aliases, country_aliases, script_aliases from localexml import Locale @@ -751,27 +752,15 @@ def main(): # Language enum qlocaleh_temp_file.write(" enum Language {\n") - language = "" - for key in language_map.keys(): - language = fixedLanguageName(language_map[key][0], dupes) + language = None + for key, value in language_map.items(): + language = fixedLanguageName(value[0], dupes) qlocaleh_temp_file.write(" " + language + " = " + str(key) + ",\n") - # legacy. should disappear at some point - qlocaleh_temp_file.write("\n") - qlocaleh_temp_file.write(" Norwegian = NorwegianBokmal,\n") - qlocaleh_temp_file.write(" Moldavian = Romanian,\n") - qlocaleh_temp_file.write(" SerboCroatian = Serbian,\n") - qlocaleh_temp_file.write(" Tagalog = Filipino,\n") - qlocaleh_temp_file.write(" Twi = Akan,\n") - # renamings - qlocaleh_temp_file.write(" Afan = Oromo,\n") - qlocaleh_temp_file.write(" Byelorussian = Belarusian,\n") - qlocaleh_temp_file.write(" Bhutani = Dzongkha,\n") - qlocaleh_temp_file.write(" Cambodian = Khmer,\n") - qlocaleh_temp_file.write(" Kurundi = Rundi,\n") - qlocaleh_temp_file.write(" RhaetoRomance = Romansh,\n") - qlocaleh_temp_file.write(" Chewa = Nyanja,\n") - qlocaleh_temp_file.write(" Frisian = WesternFrisian,\n") - qlocaleh_temp_file.write(" Uigur = Uighur,\n") + + qlocaleh_temp_file.write("\n " + + ",\n ".join('%s = %s' % pair + for pair in sorted(language_aliases.items())) + + ",\n") qlocaleh_temp_file.write("\n") qlocaleh_temp_file.write(" LastLanguage = " + language + "\n") qlocaleh_temp_file.write(" };\n") @@ -780,35 +769,28 @@ def main(): # Script enum qlocaleh_temp_file.write(" enum Script {\n") - script = "" - for key in script_map.keys(): - script = fixedScriptName(script_map[key][0], dupes) + script = None + for key, value in script_map.items(): + script = fixedScriptName(value[0], dupes) qlocaleh_temp_file.write(" " + script + " = " + str(key) + ",\n") - # renamings - qlocaleh_temp_file.write("\n") - qlocaleh_temp_file.write(" SimplifiedChineseScript = SimplifiedHanScript,\n") - qlocaleh_temp_file.write(" TraditionalChineseScript = TraditionalHanScript,\n") + qlocaleh_temp_file.write("\n " + + ",\n ".join('%s = %s' % pair + for pair in sorted(script_aliases.items())) + + ",\n") qlocaleh_temp_file.write("\n") qlocaleh_temp_file.write(" LastScript = " + script + "\n") qlocaleh_temp_file.write(" };\n") # Country enum qlocaleh_temp_file.write(" enum Country {\n") - country = "" - for key in country_map.keys(): - country = fixedCountryName(country_map[key][0], dupes) + country = None + for key, value in country_map.items(): + country = fixedCountryName(value[0], dupes) qlocaleh_temp_file.write(" " + country + " = " + str(key) + ",\n") - # deprecated - qlocaleh_temp_file.write("\n") - qlocaleh_temp_file.write(" Tokelau = TokelauCountry,\n") - qlocaleh_temp_file.write(" Tuvalu = TuvaluCountry,\n") - # renamings - qlocaleh_temp_file.write(" DemocraticRepublicOfCongo = CongoKinshasa,\n") - qlocaleh_temp_file.write(" PeoplesRepublicOfCongo = CongoBrazzaville,\n") - qlocaleh_temp_file.write(" DemocraticRepublicOfKorea = NorthKorea,\n") - qlocaleh_temp_file.write(" RepublicOfKorea = SouthKorea,\n") - qlocaleh_temp_file.write(" RussianFederation = Russia,\n") - qlocaleh_temp_file.write(" SyrianArabRepublic = Syria,\n") + qlocaleh_temp_file.write("\n " + + ",\n ".join('%s = %s' % pair + for pair in sorted(country_aliases.items())) + + ",\n") qlocaleh_temp_file.write("\n") qlocaleh_temp_file.write(" LastCountry = " + country + "\n") qlocaleh_temp_file.write(" };\n") @@ -835,7 +817,7 @@ def main(): qlocaleqdoc_temp_file = os.fdopen(qlocaleqdoc_temp_file, "w") qlocaleqdoc_file = open(qtsrcdir + "/src/corelib/tools/qlocale.qdoc", "r") s = qlocaleqdoc_file.readline() - DOCSTRING=" QLocale's data is based on Common Locale Data Repository " + DOCSTRING = " QLocale's data is based on Common Locale Data Repository " while s: if DOCSTRING in s: qlocaleqdoc_temp_file.write(DOCSTRING + "v" + cldr_version + ".\n") diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index 0f3c28137d..0c3c0b2ee1 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -2473,6 +2473,10 @@ static QByteArray createPropertyInfo() out += ", "; out += QByteArray::number( p.lowerCaseDiff ); out += ", "; + out += "#ifdef Q_OS_WASM \n" +// " unsigned char : 0; //wasm 64 packing trick QTBUG-65259\n" + out += "#endif \n" + out += ", "; // " ushort upperCaseSpecial : 1;\n" // " signed short upperCaseDiff : 15;\n" out += QByteArray::number( p.upperCaseSpecial ); @@ -2497,6 +2501,10 @@ static QByteArray createPropertyInfo() // " ushort nfQuickCheck : 8;\n" out += QByteArray::number( p.nfQuickCheck ); out += ", "; + out += "#ifdef Q_OS_WASM \n" +// " unsigned char : 0; //wasm 64 packing trick QTBUG-65259\n" + out += "#endif \n" + out += ", "; // " ushort graphemeBreakClass : 5; /* 5 used */\n" // " ushort wordBreakClass : 5; /* 5 used */\n" // " ushort sentenceBreakClass : 8; /* 4 used */\n" diff --git a/util/x86simdgen/generate.pl b/util/x86simdgen/generate.pl new file mode 100755 index 0000000000..5df2f4d526 --- /dev/null +++ b/util/x86simdgen/generate.pl @@ -0,0 +1,199 @@ +#!/usr/bin/env perl +############################################################################# +## +## Copyright (C) 2018 Intel Corporation. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the build configuration tools of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:MIT$ +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +## THE SOFTWARE. +## $QT_END_LICENSE$ +## +############################################################################# + +use strict; +$\ = "\n"; +$/ = "\n"; +my %leaves = ( + Leaf1EDX => "CPUID Leaf 1, EDX", + Leaf1ECX => "CPUID Leaf 1, ECX", + Leaf7_0EBX => "CPUID Leaf 7, Sub-leaf 0, EBX", + Leaf7_0ECX => "CPUID Leaf 7, Sub-leaf 0, ECX", + Leaf7_0EDX => "CPUID Leaf 7, Sub-leaf 0, EDX", +); +my @leafNames = sort keys %leaves; + +# Read data from stdin +my $i = 1; +my @features; +while (<STDIN>) { + s/#.*$//; + chomp; + next if $_ eq ""; + + my ($name, $function, $bit, $depends) = split /\s+/; + die("Unknown CPUID function \"$function\"") + unless grep $function, @leafNames; + + my $id = uc($name); + $id =~ s/[^A-Z0-9_]/_/g; + push @features, + { name => $name, depends => $depends, id => $id, bit => $bit, leaf => $function }; + ++$i; +} + +if (my $h = shift @ARGV) { + open HEADER, ">", $h; + select HEADER; +} + +# Print the qsimd_x86_p.h output +print q{// This is a generated file. DO NOT EDIT. +// Please see util/x86simdgen/generate.pl"; +#ifndef QSIMD_P_H +# error "Please include <private/qsimd_p.h> instead" +#endif +#ifndef QSIMD_X86_P_H +#define QSIMD_X86_P_H + +#include "qsimd_p.h" + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +// used only to indicate that the CPU detection was initialized +#define QSimdInitialized (Q_UINT64_C(1) << 0)}; + +# Print the enum +my $lastleaf; +for (my $i = 0; $i < scalar @features; ++$i) { + my $feature = $features[$i]; + # Leaf header: + printf "\n// in %s:\n", $leaves{$feature->{leaf}} + if $feature->{leaf} ne $lastleaf; + $lastleaf = $feature->{leaf}; + + # Feature + printf "#define CpuFeature%-33s (Q_UINT64_C(1) << %d)\n", $feature->{id}, $i + 1; + + # Feature string names for Clang and GCC + my $str = $feature->{name}; + $str .= ",$feature->{depends}" if defined($feature->{depends}); + printf "#define QT_FUNCTION_TARGET_STRING_%-17s \"%s\"\n", + $feature->{id}, $str; +} + +print q{ +static const quint64 qCompilerCpuFeatures = 0}; + +# And print the compiler-enabled features part: +for (my $i = 0; $i < scalar @features; ++$i) { + my $feature = $features[$i]; + printf + "#ifdef __%s__\n" . + " | CpuFeature%s\n" . + "#endif\n", + $feature->{id}, $feature->{id}; +} + +print q{ ; + +QT_END_NAMESPACE + +#endif // QSIMD_X86_P_H +}; + +if (my $cpp = shift @ARGV) { + open CPP, ">", $cpp; + select CPP; +} else { + print q{ + +---- cut here, paste the rest into qsimd_x86.cpp --- + + +}; +}; + +print "// This is a generated file. DO NOT EDIT."; +print "// Please see util/x86simdgen/generate.pl"; +print '#include "qsimd_p.h"'; +print ""; + +# Now generate the string table and bit-location array +my $offset = 0; +my @offsets; +print "static const char features_string[] ="; +for my $feature (@features) { + print " \" $feature->{name}\\0\""; + push @offsets, $offset; + $offset += 2 + length($feature->{name}); +} +print " \"\\0\";"; + +# Print the string offset table +printf "\nstatic const %s features_indices[] = {\n %3d", + $offset > 255 ? "quint16" : "quint8", $offset; +for (my $j = 0; $j < scalar @offsets; ++$j) { + printf ",%s%3d", + ($j + 1) % 8 ? " " : "\n ", $offsets[$j]; +} +print "\n};"; + +# Print the locator enum and table +print "\nenum X86CpuidLeaves {"; +map { print " $_," } @leafNames; +print " X86CpuidMaxLeaf\n};"; + +my $type = scalar %leaves > 8 ? "quint16" : "quint8"; +printf "\nstatic const %s x86_locators[] = {", + $type, $type; +my $lastname; +for (my $j = 0; $j < scalar @features; ++$j) { + my $feature = $features[$j]; + printf ", // %s", $lastname + if defined($lastname); + printf "\n %s*32 + %2d", + $feature->{leaf}, $feature->{bit}; + $lastname = $feature->{name}; +} +printf qq{ // $lastname +\}; + +// List of AVX512 features (see detectProcessorFeatures()) +static const quint64 AllAVX512 = 0}; + +# Print AVX512 features +for (my $j = 0; $j < scalar @features; ++$j) { + my $feature = $features[$j]; + $_ = $feature->{id}; + printf "\n | CpuFeature%s", $_ if /AVX512/; +} +print ";"; diff --git a/util/x86simdgen/simd.txt b/util/x86simdgen/simd.txt new file mode 100644 index 0000000000..1fce7b9497 --- /dev/null +++ b/util/x86simdgen/simd.txt @@ -0,0 +1,37 @@ +# Feature CPUID function Bit Required feature +sse2 Leaf1EDX 26 +sse3 Leaf1ECX 0 +ssse3 Leaf1ECX 9 +fma Leaf1ECX 12 +sse4.1 Leaf1ECX 19 +sse4.2 Leaf1ECX 20 +movbe Leaf1ECX 22 +popcnt Leaf1ECX 23 +aes Leaf1ECX 25 sse4.2 +avx Leaf1ECX 28 +f16c Leaf1ECX 29 +rdrnd Leaf1ECX 30 +bmi Leaf7_0EBX 3 +hle Leaf7_0EBX 4 +avx2 Leaf7_0EBX 5 +bmi2 Leaf7_0EBX 8 +rtm Leaf7_0EBX 11 +avx512f Leaf7_0EBX 16 +avx512dq Leaf7_0EBX 17 +rdseed Leaf7_0EBX 18 +avx512ifma Leaf7_0EBX 21 +avx512pf Leaf7_0EBX 26 +avx512er Leaf7_0EBX 27 +avx512cd Leaf7_0EBX 28 +sha Leaf7_0EBX 29 +avx512bw Leaf7_0EBX 30 +avx512vl Leaf7_0EBX 31 +avx512vbmi Leaf7_0ECX 1 +avx512vbmi2 Leaf7_0ECX 6 +gfni Leaf7_0ECX 8 +vaes Leaf7_0ECX 9 +avx512vnni Leaf7_0ECX 11 +avx512bitalg Leaf7_0ECX 12 +avx512vpopcntdq Leaf7_0ECX 14 +avx5124nniw Leaf7_0EDX 2 +avx5124fmaps Leaf7_0EDX 3 |