diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-05-20 13:17:02 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-05-21 12:26:38 +0200 |
| commit | 1bcb2900d87aa21f2080e9c746defcaa771f8d37 (patch) | |
| tree | 562224806a551f8086a465e2ca19104b9e650365 /gui/scripts | |
| parent | 1ca042db6f672c1b9c73713ebc38dbbef1301ae4 (diff) | |
| download | mullvadvpn-1bcb2900d87aa21f2080e9c746defcaa771f8d37.tar.xz mullvadvpn-1bcb2900d87aa21f2080e9c746defcaa771f8d37.zip | |
Add formal country name in the output
Diffstat (limited to 'gui/scripts')
| -rw-r--r-- | gui/scripts/extract-geo-data.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gui/scripts/extract-geo-data.py b/gui/scripts/extract-geo-data.py index 36c6867ed9..e9e74259ab 100644 --- a/gui/scripts/extract-geo-data.py +++ b/gui/scripts/extract-geo-data.py @@ -163,6 +163,9 @@ def extract_countries_po(): name_alt_key = "_".join(("name", convert_locale_ident(locale))) name_fallback = "name" + country_name = props.get("name") + formal_country_name = props.get("formal_en", country_name) + if props.get(name_key) is not None: translated_name = props.get(name_key) elif props.get(name_alt_key) is not None: @@ -177,11 +180,19 @@ def extract_countries_po(): ) entry = POEntry( - msgid=props["name"], + msgid=country_name, msgstr=translated_name ) po.append(entry) + # add additional record for the formal country name. + if country_name != formal_country_name and formal_country_name is not None: + entry = POEntry( + msgid=formal_country_name, + msgstr=translated_name + ) + po.append(entry) + po.save(output_path) print c.green("Extracted {} countries for {} to {}".format(len(po), locale, output_path)) |
