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

CLDR 36 #679

Merged
merged 3 commits into from Dec 31, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions babel/units.py
Expand Up @@ -88,12 +88,12 @@ def format_unit(value, measurement_unit, length='long', format=None, locale=LC_N

>>> format_unit(1, 'length-meter', locale='ro_RO')
u'1 metru'
>>> format_unit(0, 'length-picometer', locale='cy')
u'0 picometr'
>>> format_unit(2, 'length-picometer', locale='cy')
u'2 bicometr'
>>> format_unit(3, 'length-picometer', locale='cy')
u'3 phicometr'
>>> format_unit(0, 'length-mile', locale='cy')
u'0 mi'
>>> format_unit(1, 'length-mile', locale='cy')
u'1 filltir'
>>> format_unit(3, 'length-mile', locale='cy')
u'3 milltir'

>>> format_unit(15, 'length-horse', locale='fi')
Traceback (most recent call last):
Expand Down
6 changes: 3 additions & 3 deletions scripts/download_import_cldr.py
Expand Up @@ -13,9 +13,9 @@
from urllib import urlretrieve


URL = 'https://unicode.org/Public/cldr/35.1/core.zip'
FILENAME = 'cldr-core-35.1.zip'
FILESUM = 'e2ede8cb8f9c29157e281ee9e696ce540a72c598841bed595a406b710eea87b0'
URL = 'http://unicode.org/Public/cldr/36/core.zip'
FILENAME = 'cldr-core-36.zip'
FILESUM = '07279e56c1f4266d140b907ef3ec379dce0a99542303a9628562ac5fe460ba43'
BLKSIZE = 131072


Expand Down
6 changes: 4 additions & 2 deletions scripts/import_cldr.py
Expand Up @@ -77,8 +77,10 @@ def error(message, *args):
def need_conversion(dst_filename, data_dict, source_filename):
with open(source_filename, 'rb') as f:
blob = f.read(4096)
version = int(re.search(b'version number="\\$Revision: (\\d+)',
blob).group(1))
version_match = re.search(b'version number="\\$Revision: (\\d+)', blob)
if not version_match: # CLDR 36.0 was shipped without proper revision numbers
return True
version = int(version_match.group(1))

data_dict['_version'] = version
if not os.path.isfile(dst_filename):
Expand Down