summaryrefslogtreecommitdiffhomepage
path: root/gui/scripts
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2019-10-10 13:29:50 +0200
committerAndrej Mihajlov <and@mullvad.net>2019-10-14 13:52:07 +0200
commit240d707bb23e7571badba414f892bae047d68185 (patch)
treeef0bbb250767c34993f1e6bab0fca349e13dccd7 /gui/scripts
parent5cb13cea3f362d368e966f4c33b1d477e87fc2cf (diff)
downloadmullvadvpn-240d707bb23e7571badba414f892bae047d68185.tar.xz
mullvadvpn-240d707bb23e7571badba414f892bae047d68185.zip
Sort cities and countries
Diffstat (limited to 'gui/scripts')
-rw-r--r--gui/scripts/extract-geo-data.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gui/scripts/extract-geo-data.py b/gui/scripts/extract-geo-data.py
index 076430a9ca..9cdd329215 100644
--- a/gui/scripts/extract-geo-data.py
+++ b/gui/scripts/extract-geo-data.py
@@ -212,6 +212,7 @@ def extract_countries_po():
)
po.append(entry)
+ sort_pofile_entries(po)
po.save(output_path)
print c.green("Extracted {} countries for {} to {}".format(len(po), locale, output_path))
@@ -263,6 +264,7 @@ def extract_cities_po():
)
po.append(entry)
+ sort_pofile_entries(po)
po.save(output_path)
print c.green("Extracted {} cities to {}".format(len(po), output_path))
@@ -271,6 +273,10 @@ def extract_cities_po():
print_stats_table("Cities translations", stats)
+def sort_pofile_entries(pofile):
+ pofile.sort(key=lambda o: o.msgid_with_context.encode('utf-8'))
+
+
def extract_relay_translations():
try:
response = request_relays()