From: Isaac Jurado Date: Wed, 5 Nov 2014 15:40:04 +0000 (+0100) Subject: Import parent locale exceptions X-Git-Tag: dev-2a51c9b95d06~36^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=504aafe5395061c6a2c9fbbb92bc6646a379633f;p=thirdparty%2Fbabel.git Import parent locale exceptions Process and save the element, which contains the inheritance exceptions to the standard CLDR locale inheritance algorithm. --- diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index 7dcd171c..57637014 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -145,6 +145,7 @@ def main(): variant_aliases = global_data.setdefault('variant_aliases', {}) likely_subtags = global_data.setdefault('likely_subtags', {}) territory_currencies = global_data.setdefault('territory_currencies', {}) + parent_exceptions = global_data.setdefault('parent_exceptions', {}) # create auxiliary zone->territory map from the windows zones (we don't set # the 'zones_territories' map directly here, because there are some zones @@ -223,6 +224,12 @@ def main(): region_currencies.sort(key=_currency_sort_key) territory_currencies[region_code] = region_currencies + # Explicit parent locales + for paternity in sup.findall('.//parentLocales/parentLocale'): + parent = paternity.attrib['parent'] + for child in paternity.attrib['locales'].split(): + parent_exceptions[child] = parent + outfile = open(global_path, 'wb') try: pickle.dump(global_data, outfile, 2)