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>
This commit is contained in:
Edward Welbourne 2023-07-27 18:23:48 +02:00
parent 615047e98f
commit 8a762c6f0f

View File

@ -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')