summaryrefslogtreecommitdiffstats
path: root/util
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-04 09:45:28 +0200
commitbf650edb2efdc8b86df034a707aa6dd0a7278fdd (patch)
tree01812d6aaf0cb7cd635f58c79298f8bcd2dbdcbd /util
parentafe038bb0eefc1cc498b050d26ffacf1fedbac30 (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> (cherry picked from commit 8a762c6f0f1155d402fbc31f422fd4aa7fffaddd)
Diffstat (limited to 'util')
-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')