diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml index 29dce24341..89f73ee115 100644 --- a/android/res/values-ru/strings.xml +++ b/android/res/values-ru/strings.xml @@ -973,7 +973,7 @@ Заказать - Ожидание %d мин + Ожидание %s Не удалось найти такси поблизости Установить diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 7870a794c2..b5b3538358 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -977,7 +977,7 @@ Order - Expected in %d min + Expected in %s Couldn\'t find a taxi nearby Install diff --git a/iphone/Maps/ar.lproj/Localizable.strings b/iphone/Maps/ar.lproj/Localizable.strings index aec5a38859..d8bae1aaff 100644 --- a/iphone/Maps/ar.lproj/Localizable.strings +++ b/iphone/Maps/ar.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/cs.lproj/Localizable.strings b/iphone/Maps/cs.lproj/Localizable.strings index 61b8e4f861..3969909690 100644 --- a/iphone/Maps/cs.lproj/Localizable.strings +++ b/iphone/Maps/cs.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/da.lproj/Localizable.strings b/iphone/Maps/da.lproj/Localizable.strings index a96073b7a9..04741b97cc 100644 --- a/iphone/Maps/da.lproj/Localizable.strings +++ b/iphone/Maps/da.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/de.lproj/Localizable.strings b/iphone/Maps/de.lproj/Localizable.strings index 622abfd718..4afb29fca0 100644 --- a/iphone/Maps/de.lproj/Localizable.strings +++ b/iphone/Maps/de.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/en-GB.lproj/Localizable.strings b/iphone/Maps/en-GB.lproj/Localizable.strings index 9d9c4e033d..c35d4ed45a 100644 --- a/iphone/Maps/en-GB.lproj/Localizable.strings +++ b/iphone/Maps/en-GB.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/en.lproj/Localizable.strings b/iphone/Maps/en.lproj/Localizable.strings index 9032a28e99..7df2ea7462 100644 --- a/iphone/Maps/en.lproj/Localizable.strings +++ b/iphone/Maps/en.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/es.lproj/Localizable.strings b/iphone/Maps/es.lproj/Localizable.strings index 8edf56a094..3dc3fe8ace 100644 --- a/iphone/Maps/es.lproj/Localizable.strings +++ b/iphone/Maps/es.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/fi.lproj/Localizable.strings b/iphone/Maps/fi.lproj/Localizable.strings index 127473bb1d..3bd1038848 100644 --- a/iphone/Maps/fi.lproj/Localizable.strings +++ b/iphone/Maps/fi.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/fr.lproj/Localizable.strings b/iphone/Maps/fr.lproj/Localizable.strings index 90ce585b83..3ca751a100 100644 --- a/iphone/Maps/fr.lproj/Localizable.strings +++ b/iphone/Maps/fr.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/hu.lproj/Localizable.strings b/iphone/Maps/hu.lproj/Localizable.strings index 41d18346fa..7c4fcb5eb5 100644 --- a/iphone/Maps/hu.lproj/Localizable.strings +++ b/iphone/Maps/hu.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/id.lproj/Localizable.strings b/iphone/Maps/id.lproj/Localizable.strings index 4102ac532c..afb1f7da10 100644 --- a/iphone/Maps/id.lproj/Localizable.strings +++ b/iphone/Maps/id.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/it.lproj/Localizable.strings b/iphone/Maps/it.lproj/Localizable.strings index d9c485c9e6..e4623ecad0 100644 --- a/iphone/Maps/it.lproj/Localizable.strings +++ b/iphone/Maps/it.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/ja.lproj/Localizable.strings b/iphone/Maps/ja.lproj/Localizable.strings index 609fbc0ea3..fc54c1a8bf 100644 --- a/iphone/Maps/ja.lproj/Localizable.strings +++ b/iphone/Maps/ja.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/ko.lproj/Localizable.strings b/iphone/Maps/ko.lproj/Localizable.strings index 96e5bcf65e..baae31cdd6 100644 --- a/iphone/Maps/ko.lproj/Localizable.strings +++ b/iphone/Maps/ko.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/nb.lproj/Localizable.strings b/iphone/Maps/nb.lproj/Localizable.strings index 0e16dea40f..3a8028a417 100644 --- a/iphone/Maps/nb.lproj/Localizable.strings +++ b/iphone/Maps/nb.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/nl.lproj/Localizable.strings b/iphone/Maps/nl.lproj/Localizable.strings index a0e9a77568..165b3f7a0c 100644 --- a/iphone/Maps/nl.lproj/Localizable.strings +++ b/iphone/Maps/nl.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/pl.lproj/Localizable.strings b/iphone/Maps/pl.lproj/Localizable.strings index e9f18628a6..dca8ee2b27 100644 --- a/iphone/Maps/pl.lproj/Localizable.strings +++ b/iphone/Maps/pl.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/pt.lproj/Localizable.strings b/iphone/Maps/pt.lproj/Localizable.strings index df5f2c4661..a2c9f8c8cb 100644 --- a/iphone/Maps/pt.lproj/Localizable.strings +++ b/iphone/Maps/pt.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/ro.lproj/Localizable.strings b/iphone/Maps/ro.lproj/Localizable.strings index 5097f926d8..022ae41e60 100644 --- a/iphone/Maps/ro.lproj/Localizable.strings +++ b/iphone/Maps/ro.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/ru.lproj/Localizable.strings b/iphone/Maps/ru.lproj/Localizable.strings index 2dc0ad7e45..ac885d697f 100644 --- a/iphone/Maps/ru.lproj/Localizable.strings +++ b/iphone/Maps/ru.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Заказать"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Ожидание %d мин"; +"taxi_wait" = "Ожидание %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Не удалось найти такси поблизости"; diff --git a/iphone/Maps/sk.lproj/Localizable.strings b/iphone/Maps/sk.lproj/Localizable.strings index 066cac5272..4481547445 100644 --- a/iphone/Maps/sk.lproj/Localizable.strings +++ b/iphone/Maps/sk.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/sv.lproj/Localizable.strings b/iphone/Maps/sv.lproj/Localizable.strings index 287667347e..0c7c9d6855 100644 --- a/iphone/Maps/sv.lproj/Localizable.strings +++ b/iphone/Maps/sv.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/th.lproj/Localizable.strings b/iphone/Maps/th.lproj/Localizable.strings index a7ce58337f..3c657c526e 100644 --- a/iphone/Maps/th.lproj/Localizable.strings +++ b/iphone/Maps/th.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/tr.lproj/Localizable.strings b/iphone/Maps/tr.lproj/Localizable.strings index 320da7ae76..e2a9974027 100644 --- a/iphone/Maps/tr.lproj/Localizable.strings +++ b/iphone/Maps/tr.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/uk.lproj/Localizable.strings b/iphone/Maps/uk.lproj/Localizable.strings index 831591de87..99c4c6e729 100644 --- a/iphone/Maps/uk.lproj/Localizable.strings +++ b/iphone/Maps/uk.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/vi.lproj/Localizable.strings b/iphone/Maps/vi.lproj/Localizable.strings index 0463dc5eb1..5488af64d9 100644 --- a/iphone/Maps/vi.lproj/Localizable.strings +++ b/iphone/Maps/vi.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/zh-Hans.lproj/Localizable.strings b/iphone/Maps/zh-Hans.lproj/Localizable.strings index 132f7635fd..d212ca7668 100644 --- a/iphone/Maps/zh-Hans.lproj/Localizable.strings +++ b/iphone/Maps/zh-Hans.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/iphone/Maps/zh-Hant.lproj/Localizable.strings b/iphone/Maps/zh-Hant.lproj/Localizable.strings index 6e8eff1460..b6c958ad78 100644 --- a/iphone/Maps/zh-Hant.lproj/Localizable.strings +++ b/iphone/Maps/zh-Hant.lproj/Localizable.strings @@ -1640,7 +1640,7 @@ "taxi_order" = "Order"; /* How long it is until the taxi arrives */ -"taxi_wait" = "Expected in %d min"; +"taxi_wait" = "Expected in %s"; /* When there are no available taxis nearby */ "taxi_not_found" = "Couldn't find a taxi nearby"; diff --git a/strings.txt b/strings.txt index 8348d29406..a61a752738 100644 --- a/strings.txt +++ b/strings.txt @@ -19903,8 +19903,8 @@ [taxi_wait] comment = How long it is until the taxi arrives - en = Expected in %d min - ru = Ожидание %d мин + en = Expected in %s + ru = Ожидание %s [taxi_not_found] comment = When there are no available taxis nearby diff --git a/tools/python/po_parser.py b/tools/python/po_parser.py new file mode 100644 index 0000000000..04f1538daf --- /dev/null +++ b/tools/python/po_parser.py @@ -0,0 +1,99 @@ +from __future__ import print_function + +from collections import defaultdict +from argparse import ArgumentParser +from os import listdir +from os.path import isfile, join + + +TRANSFORMATION_TABLE = { + "zh_CN": "zh_Hans", + "zh_TW": "zh_Hant", + "no_NO": "no", + "en_GB": "en_GB" +} + + +#msgid +#msgstr +class PoParser: + def __init__(self, folder_path): + args = self.parse_args() + self.folder_path = args.folder + + all_po_files = self.find_all_po_files() + + + def find_all_po_files(self): + return [ + f for f in listdir(self.folder_path) + if isfile(join(self.folder_path, f)) and f.endswith(".po") + ] + + + def parse_files(self): + for key, tr in self.translations.iteritems(): + print(" [{}]\n en = {}".format(key, tr)) + + + def lang_from_filename(self, filename): + # strings_ru_RU.po + lang = filename[len("strings_"):-len(".po")] + + + def _parse_one_file(self, filepath): + self.translations = defaultdict(str) + current_key = None + string_started = False + with open(filepath) as infile: + for line in infile: + if line.startswith("msgid"): + current_key = self.clean_line(line,"msgid") + elif line.startswith("msgstr"): + if not current_key: + continue + translation = self.clean_line(line, "msgstr") + if not translation: + print("No translation for key {}".format(current_key)) + continue + self.translations[current_key] = translation + string_started = True + elif not line or line.startswith("#"): + string_started = False + current_key = None + else: + if not string_started: + continue + self.translations[current_key] = "{}{}".format(self.translations[current_key], self.clean_line(line)) + + + + + def clean_line(self, line, prefix=""): + return line[len(prefix):].strip().strip('"') + + + def parse_args(self): + parser = ArgumentParser( + description=""" + A script for parsing stirngs in the PO format, which is used by our + translation partners. + """ + ) + + parser.add_argument( + "-f", "--folder", + dest="folder", required=True, + help="""Path to the folder where the PO files are. Required.""" + ) + + + +def main(): + # parser = PoParser("en.po", "en") + # for key, tr in parser.translations.iteritems(): + # print(" [{}]\n en = {}".format(key, tr)) + pass + +if __name__ == "__main__": + main() \ No newline at end of file