]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
cldr: use CLDR 30.0.2 (and fix test changes)
authorAarni Koskela <akx@iki.fi>
Mon, 21 Nov 2016 14:38:54 +0000 (16:38 +0200)
committerAarni Koskela <akx@iki.fi>
Wed, 17 Jan 2018 07:14:18 +0000 (09:14 +0200)
babel/units.py
scripts/download_import_cldr.py
scripts/import_cldr.py
tests/test_date_intervals.py
tests/test_lists.py

index 1ea5b17cc1715386a9ca8013245b6db0d68f99c4..4260b3d5687d35924406564c622c6f6b0a78b136 100644 (file)
@@ -201,7 +201,7 @@ def format_compound_unit(
     '150 kilometer per timme'
 
     >>> format_compound_unit(150, "kilowatt", denominator_unit="year", locale="fi")
-    '150 kilowattia vuodessa'
+    '150 kilowattia / vuosi'
 
     >>> format_compound_unit(32.5, "ton", 15, denominator_unit="hour", locale="en")
     '32.5 tons per 15 hours'
index 4cc6a4b9b601d7e9c3be3764c1a11e4ab07ebe45..9914a113e27df0c905104a56420e514f518c0a9b 100755 (executable)
@@ -13,9 +13,9 @@ except ImportError:
     from urllib import urlretrieve
 
 
-URL = 'http://unicode.org/Public/cldr/29/core.zip'
-FILENAME = 'core-29.zip'
-FILESUM = '44d117e6e591a8f9655602ff0abdee105df3cabe'
+URL = 'http://unicode.org/Public/cldr/30.0.2/core.zip'
+FILENAME = 'core-30.0.2.zip'
+FILESUM = '7d21d5f34a2b94f78f737d9279bcaae85ccc5332'
 BLKSIZE = 131072
 
 
index 7b9e7734ba5821e9b2bbae43134aad5ef7301b7e..4f49491cad295001742dfe8dd4bb714fc0edd618 100755 (executable)
@@ -708,14 +708,18 @@ def parse_number_symbols(data, tree):
 def parse_decimal_formats(data, tree):
     decimal_formats = data.setdefault('decimal_formats', {})
     for elem in tree.findall('.//decimalFormats/decimalFormatLength'):
-        type = elem.attrib.get('type')
-        if _should_skip_elem(elem, type, decimal_formats):
+        length_type = elem.attrib.get('type')
+        if _should_skip_elem(elem, length_type, decimal_formats):
             continue
         if elem.findall('./alias'):
             # TODO map the alias to its target
             continue
-        pattern = text_type(elem.findtext('./decimalFormat/pattern'))
-        decimal_formats[type] = numbers.parse_pattern(pattern)
+        for pattern_el in elem.findall('./decimalFormat/pattern'):
+            pattern_type = pattern_el.attrib.get('type')
+            pattern = numbers.parse_pattern(text_type(pattern_el.text))
+            if not pattern_type:
+                # Regular decimal format.
+                decimal_formats[length_type] = pattern
 
 
 def parse_scientific_formats(data, tree):
index e5a797a94daed0206c6e5e2cebe2f907b9fe0235..2e5f0d6e2331f48e85c0eff761ccd7e4960b4760 100644 (file)
@@ -13,7 +13,7 @@ TEST_DATE = TEST_DT.date()
 
 
 def test_format_interval_same_instant_1():
-    assert dates.format_interval(TEST_DT, TEST_DT, "yMMMd", fuzzy=False, locale="fi") == "8. tammikuuta 2016"
+    assert dates.format_interval(TEST_DT, TEST_DT, "yMMMd", fuzzy=False, locale="fi") == "8. tammik. 2016"
 
 
 def test_format_interval_same_instant_2():
index f5021ea500e0de7ae12ef39785e771c2b3b97139..bd297ec38a5cb90c9b94f38dd4eaae48bff57331 100644 (file)
@@ -9,6 +9,6 @@ def test_format_list():
         (['string1', 'string2'], 'en', u'string1 and string2'),
         (['string1', 'string2', 'string3'], 'en', u'string1, string2, and string3'),
         (['string1', 'string2', 'string3'], 'zh', u'string1、string2和string3'),
-        (['string1', 'string2', 'string3', 'string4'], 'ne', u'string1 र string2, string3 र string4'),
+        (['string1', 'string2', 'string3', 'string4'], 'ne', u'string1,string2, string3 र string4'),
     ]:
         assert lists.format_list(list, locale=locale) == expected