summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Potashev <[email protected]>2015-04-03 02:17:42 +0300
committerAlexander Potashev <[email protected]>2015-04-03 16:23:30 +0300
commit647ed08686dd727d21ecccbe4ef2f9d0b9864239 (patch)
tree94ada4c477a57c4a1fcbdc7bbe1aceb35f90ca19
parent8692a75683060d8a30ead2dddece5fd05fbfb0d6 (diff)
Fix untranslatable city/region/country names
This fixes the whole city translation because kstars/geolocation.cpp relies on the old i18n contexts like "Country name", etc. The context strings are now again descriptive and also avoid merged strings that cannot be translated properly. This commit does not break the string freeze because all city/region/country names were previously untranslatable. CCMAIL: [email protected]
-rw-r--r--kstars/data/scripts/extract_geo_data.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/kstars/data/scripts/extract_geo_data.py b/kstars/data/scripts/extract_geo_data.py
index 590e255..07eef6c 100644
--- a/kstars/data/scripts/extract_geo_data.py
+++ b/kstars/data/scripts/extract_geo_data.py
@@ -8,23 +8,35 @@ db.text_factory = str
cursor = db.cursor()
-cursor.execute('''SELECT DISTINCT Name from city''')
+cursor.execute('''SELECT DISTINCT Name, Province, Country from city''')
all_rows = cursor.fetchall()
all_rows.sort()
-for row in all_rows:
- print('xi18nc("City name (optional, probably does not need a translation)", "{0}")'.format(row[0]))
+for row in all_rows:
+ name = row[0]
+ province = row[1]
+ country = row[2]
+
+ if format(province) != '':
+ place = "{0} {1}".format(province, country)
+ else:
+ place = country
-cursor.execute('''SELECT DISTINCT Province from city''')
+ print('xi18nc("City in {0}", "{1}")'.format(place, name))
+
+cursor.execute('''SELECT DISTINCT Province, Country from city''')
all_rows = cursor.fetchall()
all_rows.sort()
for row in all_rows:
- if format(row[0]) != '':
- print('xi18nc("Province name (optional, rarely needs a translation)", "{0}")'.format(row[0]))
+ province = row[0]
+ country = row[1]
+
+ if format(province) != '':
+ print('xi18nc("Region/state in {0}", "{1}")'.format(country, province))
cursor.execute('''SELECT DISTINCT Country from city''')
all_rows = cursor.fetchall()
all_rows.sort()
for row in all_rows:
- print('xi18nc("Country name (optional, but should be translated)", "{0}")'.format(row[0]))
+ print('xi18nc("Country name", "{0}")'.format(row[0]))
-db.close() \ No newline at end of file
+db.close()