summaryrefslogtreecommitdiffstats
path: root/util/locale_database
diff options
context:
space:
mode:
Diffstat (limited to 'util/locale_database')
-rwxr-xr-xutil/locale_database/cldr2qlocalexml.py6
-rw-r--r--util/locale_database/qlocalexml.py (renamed from util/locale_database/localexml.py)9
-rwxr-xr-xutil/locale_database/qlocalexml2cpp.py6
3 files changed, 10 insertions, 11 deletions
diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py
index fdb0a34037..7f98e29d47 100755
--- a/util/locale_database/cldr2qlocalexml.py
+++ b/util/locale_database/cldr2qlocalexml.py
@@ -61,7 +61,7 @@ import enumdata
import xpathlite
from xpathlite import DraftResolution, findAlias, findEntry, findTagsInFile
from dateconverter import convert_date
-from localexml import Locale
+from qlocalexml import Locale
# TODO: make calendars a command-line option
calendars = ['gregorian', 'persian', 'islamic'] # 'hebrew'
@@ -335,8 +335,8 @@ def _generateLocaleInfo(path, language_code, script_code, country_code, variant_
endonym = findEntryDef(path, "localeDisplayNames/languages/language[type=%s_%s]" % (language_code, country_code))
if not endonym:
endonym = findEntryDef(path, "localeDisplayNames/languages/language[type=%s]" % (language_code))
- result['language_endonym'] = endonym
- result['country_endonym'] = findEntryDef(path, "localeDisplayNames/territories/territory[type=%s]" % (country_code))
+ result['languageEndonym'] = endonym
+ result['countryEndonym'] = findEntryDef(path, "localeDisplayNames/territories/territory[type=%s]" % (country_code))
currency_format = get_number_in_system(path, "numbers/currencyFormats/currencyFormatLength/currencyFormat/pattern", numbering_system)
currency_format = parse_number_format(currency_format, result)
diff --git a/util/locale_database/localexml.py b/util/locale_database/qlocalexml.py
index 85ecb2d6ca..b4fbe86be5 100644
--- a/util/locale_database/localexml.py
+++ b/util/locale_database/qlocalexml.py
@@ -169,7 +169,7 @@ class Locale:
for key in ('decimal', 'group', 'zero', 'list', 'percent', 'minus', 'plus', 'exp'):
print inner + "<%s>" % key + get(key) + "</%s>" % key
- for key in ('language_endonym', 'country_endonym',
+ for key in ('languageEndonym', 'countryEndonym',
'quotationStart', 'quotationEnd',
'alternateQuotationStart', 'alternateQuotationEnd',
'listPatternPartStart', 'listPatternPartMiddle',
@@ -187,8 +187,7 @@ class Locale:
'_'.join((k, cal))
for k in self.propsMonthDay('months')
for cal in calendars):
- ent = camelCase(key.split('_')) if key.endswith('_endonym') else key
- print inner + "<%s>%s</%s>" % (ent, escape(get(key)).encode('utf-8'), ent)
+ print inner + "<%s>%s</%s>" % (key, escape(get(key)).encode('utf-8'), key)
for key in ('currencyDigits', 'currencyRounding'):
print inner + "<%s>%d</%s>" % (key, get(key), key)
@@ -262,9 +261,9 @@ class Locale:
quantifiers=('k', 'M', 'G', 'T', 'P', 'E')):
"""Returns an object representing the C locale."""
return cls(dict(cls.__monthNames(calendars)),
- language='C', language_code='0', language_endonym='',
+ language='C', language_code='0', languageEndonym='',
script='AnyScript', script_code='0',
- country='AnyCountry', country_code='0', country_endonym='',
+ country='AnyCountry', country_code='0', countryEndonym='',
decimal='.', group=',', list=';', percent='%',
zero='0', minus='-', plus='+', exp='e',
quotationStart='"', quotationEnd='"',
diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py
index bb9f138c18..3dde298f47 100755
--- a/util/locale_database/qlocalexml2cpp.py
+++ b/util/locale_database/qlocalexml2cpp.py
@@ -40,7 +40,7 @@ import datetime
import xml.dom.minidom
from enumdata import language_aliases, country_aliases, script_aliases
-from localexml import Locale
+from qlocalexml import Locale
# TODO: Make calendars a command-line parameter
# map { CLDR name: Qt file name }
@@ -373,7 +373,7 @@ def main():
if len(sys.argv) != 3:
usage()
- localexml = sys.argv[1]
+ qlocalexml = sys.argv[1]
qtsrcdir = sys.argv[2]
if not (os.path.isdir(qtsrcdir)
@@ -390,7 +390,7 @@ def main():
s = qlocaledata_file.readline()
data_temp_file.write(GENERATED_BLOCK_START)
- doc = xml.dom.minidom.parse(localexml)
+ doc = xml.dom.minidom.parse(qlocalexml)
language_map = loadMap(doc, 'language')
script_map = loadMap(doc, 'script')
country_map = loadMap(doc, 'country')