From: Aarni Koskela Date: Fri, 2 Feb 2018 15:52:47 +0000 (+0200) Subject: import_cldr: avoid importing alt=narrow currency symbols X-Git-Tag: v2.6.0~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F558%2Fhead;p=thirdparty%2Fbabel.git import_cldr: avoid importing alt=narrow currency symbols Fixes #397 Closes #483, #556 --- diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index ab676a90..b81fa609 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -770,8 +770,11 @@ def parse_currency_names(data, tree): name.attrib['count']] = text_type(name.text) else: currency_names[code] = text_type(name.text) - symbol = elem.find('symbol') - if symbol is not None and 'draft' not in symbol.attrib and 'choice' not in symbol.attrib: + for symbol in elem.findall('symbol'): + if 'draft' in symbol.attrib or 'choice' in symbol.attrib: # Skip drafts and choice-patterns + continue + if symbol.attrib.get('alt'): # Skip alternate forms + continue currency_symbols[code] = text_type(symbol.text)