From b611f0c6175e85e9caea6dab8add35d1a2968dec Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Fri, 2 Feb 2018 17:52:47 +0200 Subject: [PATCH] import_cldr: avoid importing alt=narrow currency symbols Fixes #397 Closes #483, #556 --- scripts/import_cldr.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.47.2