From 69aefa4edff10869c6351eb82b5828069384f7f1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 26 Apr 2024 16:42:29 +0200 Subject: [PATCH] Update C Locale constructor to match others on ids and codes It was setting *_code='0' for the Any* forms of language, script and territory; this is wrong, the codes for these are all empty or other special tokens (like 'und', 'Zzzz', 'ZZ'). The IDs for them are zero, as an int not a string, but were omitted. Also add the variant details, for all that they're currently unused, for consistency. This makes no difference to the generated data. Task-number: QTBUG-115158 Change-Id: I339d1b201e50e2bbc510758ffbbaae0fa02277d4 Reviewed-by: Mate Barany --- util/locale_database/qlocalexml.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index 7f3247cb2df..bb2d62c0412 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -601,9 +601,12 @@ class Locale (object): base[k] = ';'.join(x[:3] for x in base[k].split(';')) return cls(base, - language='C', language_code='0', languageEndonym='', - script='AnyScript', script_code='0', - territory='AnyTerritory', territory_code='0', territoryEndonym='', + language='C', language_code='', + language_id=0, languageEndonym='', + script='AnyScript', script_code='', script_id=0, + territory='AnyTerritory', territory_code='', + territory_id=0, territoryEndonym='', + variant='', variant_code='', variant_id=0, # CLDR has non-ASCII versions of these: quotationStart='"', quotationEnd='"', alternateQuotationStart="'", alternateQuotationEnd="'",