Skip to content

Commit

Permalink
Merge pull request #853 from akx/cldr-41
Browse files Browse the repository at this point in the history
CLDR 41
  • Loading branch information
akx committed Apr 8, 2022
2 parents 10b3d6e + dcfae60 commit 20352cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions scripts/download_import_cldr.py
Expand Up @@ -13,10 +13,10 @@
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


Expand Down
6 changes: 6 additions & 0 deletions scripts/import_cldr.py
Expand Up @@ -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')
Expand All @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_numbers.py
Expand Up @@ -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():
Expand Down

0 comments on commit 20352cc

Please sign in to comment.