From 8a762c6f0f1155d402fbc31f422fd4aa7fffaddd Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 27 Jul 2023 18:23:48 +0200 Subject: [PATCH] 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 --- util/locale_database/ldml.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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')