]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
import_cldr: avoid importing alt=narrow currency symbols 558/head
authorAarni Koskela <akx@iki.fi>
Fri, 2 Feb 2018 15:52:47 +0000 (17:52 +0200)
committerAarni Koskela <akx@iki.fi>
Fri, 2 Feb 2018 15:52:47 +0000 (17:52 +0200)
Fixes #397

Closes #483, #556

scripts/import_cldr.py

index ab676a901b0afea6440bd95e0af514fc7017542a..b81fa609138fe96069951d8cfc32cb59b91e7394 100755 (executable)
@@ -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)