summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/locale_database/cldr2qlocalexml.py2
-rw-r--r--util/locale_database/localexml.py17
-rwxr-xr-xutil/locale_database/qlocalexml2cpp.py2
3 files changed, 18 insertions, 3 deletions
diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py
index b611aa7eb7..072ea9e4ed 100755
--- a/util/locale_database/cldr2qlocalexml.py
+++ b/util/locale_database/cldr2qlocalexml.py
@@ -64,7 +64,7 @@ from dateconverter import convert_date
from localexml import Locale
# TODO: make calendars a command-line option
-calendars = ['gregorian', 'persian'] # 'islamic', 'hebrew'
+calendars = ['gregorian', 'persian', 'islamic'] # 'hebrew'
findEntryInFile = xpathlite._findEntryInFile
def wrappedwarn(prefix, tokens):
return sys.stderr.write(
diff --git a/util/locale_database/localexml.py b/util/locale_database/localexml.py
index 72b1dc2acc..9b353f5122 100644
--- a/util/locale_database/localexml.py
+++ b/util/locale_database/localexml.py
@@ -225,6 +225,15 @@ class Locale:
def firstThree(i, name): return name[:3]
def initial(i, name): return name[:1]
def number(i, name): return str(i + 1)
+ def islamicShort(i, name):
+ if not name: return name
+ if name == 'Shawwal': return 'Shaw.'
+ words = name.split()
+ if words[0].startswith('Dhu'):
+ words[0] = words[0][:7] + '.'
+ elif len(words[0]) > 3:
+ words[0] = words[0][:3] + '.'
+ return ' '.join(words)
@staticmethod
def __monthNames(calendars,
known={ # Map calendar to (names, extractors...):
@@ -239,6 +248,12 @@ class Locale:
(fullName, fullName),
(firstThree, firstThree),
(number, initial)),
+ 'islamic': ((u'Muharram', u'Safar', u'Rabiʻ I', u'Rabiʻ II', u'Jumada I',
+ u'Jumada II', u'Rajab', u'Shaʻban', u'Ramadan', u'Shawwal',
+ u'Dhuʻl-Qiʻdah', u'Dhuʻl-Hijjah'),
+ (fullName, fullName),
+ (islamicShort, islamicShort),
+ (number, number)),
'hebrew': (('Tishri', 'Heshvan', 'Kislev', 'Tevet', 'Shevat', 'Adar I',
'Adar', 'Nisan', 'Iyar', 'Sivan', 'Tamuz', 'Av'),
(fullName, fullName),
@@ -258,7 +273,7 @@ class Locale:
';'.join(get[n][0](i, x) for i, x in enumerate(names)))
yield ('_'.join((camelCase(('standalone', size, 'months')), cal)),
';'.join(get[n][1](i, x) for i, x in enumerate(names)))
- del fullName, firstThree, initial, number
+ del fullName, firstThree, initial, number, islamicShort
@classmethod
def C(cls, calendars=('gregorian',),
diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py
index 130c2dca73..a5ff7ebbf4 100755
--- a/util/locale_database/qlocalexml2cpp.py
+++ b/util/locale_database/qlocalexml2cpp.py
@@ -44,7 +44,7 @@ from localexml import Locale
# TODO: Make calendars a command-line parameter
# map { CLDR name: Qt file name }
-calendars = {'gregorian': 'roman', 'persian': 'jalali',} # 'islamic': 'hijri', 'hebrew': 'hebrew',
+calendars = {'gregorian': 'roman', 'persian': 'jalali', 'islamic': 'hijri',} # 'hebrew': 'hebrew',
generated_template = """
/*