summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/download_import_cldr.py6
-rwxr-xr-xscripts/import_cldr.py12
2 files changed, 11 insertions, 7 deletions
diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py
index 4cc6a4b..9914a11 100755
--- a/scripts/download_import_cldr.py
+++ b/scripts/download_import_cldr.py
@@ -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
diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py
index 7b9e773..4f49491 100755
--- a/scripts/import_cldr.py
+++ b/scripts/import_cldr.py
@@ -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):