summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rwxr-xr-xgui/scripts/extract-geo-data.py34
1 files changed, 3 insertions, 31 deletions
diff --git a/gui/scripts/extract-geo-data.py b/gui/scripts/extract-geo-data.py
index cb18ee040a..2198a6f7e0 100755
--- a/gui/scripts/extract-geo-data.py
+++ b/gui/scripts/extract-geo-data.py
@@ -164,7 +164,6 @@ def extract_relay_locations_pot(countries):
comment=country_code.upper()
)
pot.append(entry)
- print("{} ({})".format(country["name"], country.get("code")))
cities = country["cities"]
for city_code in cities:
@@ -179,8 +178,6 @@ def extract_relay_locations_pot(countries):
except ValueError as err:
print(c.orange("Cannot add an entry: {}".format(err)))
- print("{} ({})".format(city["name"], city["code"]))
-
pot.save(output_path)
@@ -258,20 +255,13 @@ def translate_single_relay_locations(country_translator, city_translator, countr
country_name = country["name"]
translated_country_name = country_translator.translate(locale, country_code)
- found_country_translation = translated_country_name is not None
# Default to empty string if no translation was found
- if found_country_translation:
+ if translated_country_name is not None:
hits += 1
else:
translated_country_name = ""
misses += 1
- log_message = "{} ({}) -> \"{}\"".format(country_name, country_code, translated_country_name)
- if found_country_translation:
- print(c.green(log_message))
- else:
- print(c.orange(log_message))
-
# translate country
entry = POEntry(
msgid=country_name,
@@ -303,12 +293,6 @@ def translate_single_relay_locations(country_translator, city_translator, countr
translated_name = ""
misses += 1
- log_message = "{} ({}) -> \"{}\"".format(city_name, city_code, translated_name)
- if found_translation:
- print(c.green(log_message))
- else:
- print(c.orange(log_message))
-
entry = POEntry(
msgid=city_name,
msgstr=translated_name,
@@ -348,13 +332,7 @@ class CountryTranslator:
if props is not None:
name_key = "name_" + map_locale(locale)
- value = props.get(name_key)
-
- if value is None:
- print(c.orange("Missing translation for {} ({}) under the {} key"
- .format(iso_a2, locale, name_key)))
- else:
- return value
+ return props.get(name_key)
return None
@@ -401,13 +379,7 @@ class CityTranslator:
if props is not None:
name_key = "name_" + map_locale(locale)
- value = props.get(name_key)
-
- if value is None:
- print(c.orange("Missing translation for {} ({}) under the {} key"
- .format(english_name, locale, name_key)))
- else:
- return value
+ return props.get(name_key)
return None