From e71bf9d5c7b14fb3e3b7f970440060c5fd9f9059 Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Thu, 8 Aug 2019 20:27:18 +0200 Subject: Add support for the Jalali (Solar Hijri or Persian) calendar This has its own locale data, extracted from CLDR. [ChangeLog][QtCore][QCalendar] Added support for the Jalali (Persian or Solar Hijri) calendar, controlled by feature jalalicalendar. Fixes: QTBUG-58404 Change-Id: Id5c56a10db05a4fd612aafc01615273db81ec743 Reviewed-by: Paul Wicking Reviewed-by: Volker Hilsheimer --- util/locale_database/cldr2qlocalexml.py | 2 +- util/locale_database/localexml.py | 5 +++++ util/locale_database/qlocalexml2cpp.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py index 4bc735976b..b611aa7eb7 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 c83f9cea21..72b1dc2acc 100644 --- a/util/locale_database/localexml.py +++ b/util/locale_database/localexml.py @@ -234,6 +234,11 @@ class Locale: (fullName, fullName), # long (firstThree, firstThree), # short (number, initial)), # narrow + 'persian': (('Farvardin', 'Ordibehesht', 'Khordad', 'Tir', 'Mordad', + 'Shahrivar', 'Mehr', 'Aban', 'Azar', 'Dey', 'Bahman', 'Esfand'), + (fullName, fullName), + (firstThree, firstThree), + (number, initial)), 'hebrew': (('Tishri', 'Heshvan', 'Kislev', 'Tevet', 'Shevat', 'Adar I', 'Adar', 'Nisan', 'Iyar', 'Sivan', 'Tamuz', 'Av'), (fullName, fullName), diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py index 641a80baf5..130c2dca73 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 = """ /* -- cgit v1.2.3