summaryrefslogtreecommitdiffstats
path: root/util/locale_database/ldml.py
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-07-27 18:23:48 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2023-08-01 15:36:20 +0200
commit8a762c6f0f1155d402fbc31f422fd4aa7fffaddd (patch)
treecd8d7ef85e4dc4c6e85e3d2789619bdf62800ed5 /util/locale_database/ldml.py
parent615047e98f1ef2a6d1d1d1830c74d1d02dcec336 (diff)
Cope with CLDR data conflict decimal == group
The digit-grouping and fractional-part separators need to be distinct for parsing to be able to distinguish between two thousand and one vs two and one thousandth. Thakfully ldml.py asserted this, so caught the glitch in CLDR v43's data where mn_Mong_MN over-rode mn's decimal, but not group, and thereby clashed with group. Fortunately the over-ride is marked as draft="contributed" so we can back out of the collision and limit the selection to draft="approved" values (but only when there *is* such a conflict, as plenty of locales have (compatible) draft data), thereby ignoring the conflicting contribution. Brought to the attention of cldr-users at: https://groups.google.com/a/unicode.org/g/cldr-users/c/6kW9kC6fz3g hopefully that'll lead to a saner resolution at v44. Task-number: QTBUG-111550 Change-Id: I1332486e60481cb4494446c0c87d89d74bd317d4 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'util/locale_database/ldml.py')
-rw-r--r--util/locale_database/ldml.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/locale_database/ldml.py b/util/locale_database/ldml.py
index f0a8be520e..d46cb3a27e 100644
--- a/util/locale_database/ldml.py
+++ b/util/locale_database/ldml.py
@@ -270,7 +270,13 @@ class LocaleScanner (object):
stem = f'numbers/symbols[numberSystem={system}]/'
decimal = self.find(f'{stem}decimal')
group = self.find(f'{stem}group')
- assert decimal != group, (self.name, system, decimal)
+ if decimal == group:
+ # mn_Mong_MN @v43 :-(
+ clean = Node.draftScore('approved')
+ decimal = self.find(f'{stem}decimal', draft=clean)
+ group = self.find(f'{stem}group', draft=clean)
+ assert decimal != group, (self.name, system, decimal)
+
yield 'decimal', decimal
yield 'group', group
yield 'percent', self.find(f'{stem}percentSign')