summaryrefslogtreecommitdiffstats
path: root/util/locale_database/ldml.py
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-01-09 16:08:15 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2024-01-19 15:38:25 +0100
commitbcdd51cfae24731a73d008add23d3c1e85bbd8d0 (patch)
treed3bc1bfbcfdcf7b2202d94f82cf3452ed071dd1b /util/locale_database/ldml.py
parentfcd2a219c4c222309152f1ea2a3124ddc17d4ea5 (diff)
Prepare to support taking CLDR data from its github upstream
We've previously used the zip-file form, but that's not been published for CLDR v44.1 - the advice on the list was to use github instead. That, however, has ↑↑↑ as a special value for fields, meaning to inherit from a prent locale. So special-case that value. I have verified that v44 from the zip file produces identical results to v44 from github, with this minor fix. As it happens v44.1 also produces identical results. Pick-to: 6.7 6.5 Change-Id: I6eb0aedda7556753cdc83bb9d76652fbb68dc669 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'util/locale_database/ldml.py')
-rw-r--r--util/locale_database/ldml.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/locale_database/ldml.py b/util/locale_database/ldml.py
index d46cb3a27e..2a029ce98b 100644
--- a/util/locale_database/ldml.py
+++ b/util/locale_database/ldml.py
@@ -204,7 +204,10 @@ class LocaleScanner (object):
for elt in self.__find(xpath):
try:
if draft is None or elt.draft <= draft:
- return elt.dom.firstChild.nodeValue
+ value = elt.dom.firstChild.nodeValue
+ # The github version of CLDR uses '↑↑↑' to indicate "inherit"
+ if value != '↑↑↑':
+ return value
except (AttributeError, KeyError):
pass
except Error as e: