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 <mate.barany@qt.io>
This commit is contained in:
Edward Welbourne 2024-04-26 16:42:29 +02:00
parent 0c809fc3b5
commit 69aefa4edf

View File

@ -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="'",