summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2022-04-08 18:41:04 +0300
committerGitHub <noreply@github.com>2022-04-08 18:41:04 +0300
commit20352cc667cd3f35c190b966cfc042cc3f2400a5 (patch)
tree0cb34c8a891b6bc8e017b450fb21aebb50fc43f6
parent10b3d6eec0d4cf2d76e451c0a0df5152b454e3db (diff)
parentdcfae607fa7f29477b99094a08365deb51cd7d3d (diff)
downloadbabel-20352cc667cd3f35c190b966cfc042cc3f2400a5.tar.gz
Merge pull request #853 from akx/cldr-41
CLDR 41
-rwxr-xr-xscripts/download_import_cldr.py8
-rwxr-xr-xscripts/import_cldr.py6
-rw-r--r--tests/test_numbers.py2
3 files changed, 11 insertions, 5 deletions
diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py
index 5a6640f..5739cc8 100755
--- a/scripts/download_import_cldr.py
+++ b/scripts/download_import_cldr.py
@@ -13,10 +13,10 @@ except ImportError:
from urllib import urlretrieve
-URL = 'http://unicode.org/Public/cldr/40/cldr-common-40.0.zip'
-FILENAME = 'cldr-common-40.0.zip'
-# Via https://unicode.org/Public/cldr/40/hashes/SHASUM512.txt
-FILESUM = 'b45ea381002210cf5963a2ba52fa45ee4e9b1e80ae1180bcecf61f431d64e4e0faba700b3d56a96a33355deab3abdb8bcbae9222b60a8ca85536476718175645'
+URL = 'http://unicode.org/Public/cldr/41/cldr-common-41.0.zip'
+FILENAME = 'cldr-common-41.0.zip'
+# Via https://unicode.org/Public/cldr/41/hashes/SHASUM512
+FILESUM = 'c64f3338e292962817b043dd11e9c47f533c9b70d432f83e80654e20f4937c72b37e66a60485df43f734b1ff94ebf0452547a063076917889303c9653b4d6ce5'
BLKSIZE = 131072
diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py
index 5fda2de..6fe9b8b 100755
--- a/scripts/import_cldr.py
+++ b/scripts/import_cldr.py
@@ -845,6 +845,9 @@ def parse_unit_patterns(data, tree):
unit_type = unit.attrib['type']
unit_and_length_patterns = unit_patterns.setdefault(unit_type, {}).setdefault(unit_length_type, {})
for pattern in unit.findall('unitPattern'):
+ if pattern.attrib.get('case', 'nominative') != 'nominative':
+ # Skip non-nominative cases.
+ continue
unit_and_length_patterns[pattern.attrib['count']] = _text(pattern)
per_unit_pat = unit.find('perUnitPattern')
@@ -860,6 +863,9 @@ def parse_unit_patterns(data, tree):
compound_unit_info = {}
compound_variations = {}
for child in unit:
+ if child.attrib.get('case', 'nominative') != 'nominative':
+ # Skip non-nominative cases.
+ continue
if child.tag == "unitPrefixPattern":
compound_unit_info['prefix'] = _text(child)
elif child.tag == "compoundUnitPattern":
diff --git a/tests/test_numbers.py b/tests/test_numbers.py
index 00abd93..a77efc4 100644
--- a/tests/test_numbers.py
+++ b/tests/test_numbers.py
@@ -238,7 +238,7 @@ def test_list_currencies():
assert list_currencies(locale='pa_Arab') == {'PKR', 'INR', 'EUR'}
- assert len(list_currencies()) == 303
+ assert len(list_currencies()) == 305
def test_validate_currency():