Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to CLDR 43 #1043

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion babel/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def interval_formats(self) -> localedata.LocaleDataDict:
smallest changing component:

>>> Locale('fi_FI').interval_formats['MEd']['d']
[u'E d. \u2013 ', u'E d.M.']
[u'E d.\u2009\u2013\u2009', u'E d.M.']

.. seealso::

Expand Down
8 changes: 4 additions & 4 deletions scripts/download_import_cldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import zipfile
from urllib.request import urlretrieve

URL = 'http://unicode.org/Public/cldr/42/cldr-common-42.0.zip'
FILENAME = 'cldr-common-42.0.zip'
# Via https://unicode.org/Public/cldr/42/hashes/SHASUM512
FILESUM = '315448fe6a9ac2d5a6a7fd1a27b38c5db30fed053654a803d50e3a8d06aa08ad153e8e57089fa094c561f41a54f37eecda0701b47a1813879902be71945aa38a'
URL = 'http://unicode.org/Public/cldr/43/cldr-common-43.0.zip'
FILENAME = 'cldr-common-43.0.zip'
# Via https://unicode.org/Public/cldr/43/hashes/SHASUM512
FILESUM = '930c64208d6f680d115bfa74a69445fb614910bb54233227b0b9ae85ddbce4db19e4ec863bf04ae9d4a11b2306aa7394e553384d7537487de8011f0e34877cef'
BLKSIZE = 131072


Expand Down
20 changes: 16 additions & 4 deletions scripts/import_cldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,22 @@ def parse_global(srcdir, sup):
currency: tuple(sorted(regions)) for currency, regions in all_currencies.items()}

# Explicit parent locales
for paternity in sup.findall('.//parentLocales/parentLocale'):
parent = paternity.attrib['parent']
for child in paternity.attrib['locales'].split():
parent_exceptions[child] = parent
# Since CLDR-43, there are multiple <parentLocales> statements, some of them with a `component="collations"` or
# `component="segmentations"` attribute; these indicate that only some language aspects should be inherited.
# (https://cldr.unicode.org/index/downloads/cldr-43)
#
# Ignore these for now, as one of them even points to a locale that doesn't have a corresponding XML file (sr_ME)
# and we crash trying to load it.
# There is no XPath support to test for an absent attribute, so use Python to filter
for parentBlock in sup.findall('.//parentLocales'):
if parentBlock.attrib.get('component'):
# Consider only unqualified parent declarations
continue

for paternity in parentBlock.findall('./parentLocale'):
parent = paternity.attrib['parent']
for child in paternity.attrib['locales'].split():
parent_exceptions[child] = parent

# Currency decimal and rounding digits
for fraction in sup.findall('.//currencyData/fractions/info'):
Expand Down