diff --git a/metadata/android/cs/full_description.txt b/metadata/android/cs-CZ/full_description.txt similarity index 100% rename from metadata/android/cs/full_description.txt rename to metadata/android/cs-CZ/full_description.txt diff --git a/metadata/android/cs/short_description.txt b/metadata/android/cs-CZ/short_description.txt similarity index 100% rename from metadata/android/cs/short_description.txt rename to metadata/android/cs-CZ/short_description.txt diff --git a/metadata/android/cs/title.txt b/metadata/android/cs-CZ/title.txt similarity index 100% rename from metadata/android/cs/title.txt rename to metadata/android/cs-CZ/title.txt diff --git a/metadata/android/de/full_description.txt b/metadata/android/de-DE/full_description.txt similarity index 100% rename from metadata/android/de/full_description.txt rename to metadata/android/de-DE/full_description.txt diff --git a/metadata/android/de/short_description.txt b/metadata/android/de-DE/short_description.txt similarity index 100% rename from metadata/android/de/short_description.txt rename to metadata/android/de-DE/short_description.txt diff --git a/metadata/android/de/title.txt b/metadata/android/de-DE/title.txt similarity index 100% rename from metadata/android/de/title.txt rename to metadata/android/de-DE/title.txt diff --git a/metadata/android/en/changelogs/11.txt b/metadata/android/en-US/changelogs/11.txt similarity index 100% rename from metadata/android/en/changelogs/11.txt rename to metadata/android/en-US/changelogs/11.txt diff --git a/metadata/android/en/changelogs/12.txt b/metadata/android/en-US/changelogs/12.txt similarity index 100% rename from metadata/android/en/changelogs/12.txt rename to metadata/android/en-US/changelogs/12.txt diff --git a/metadata/android/en/changelogs/13.txt b/metadata/android/en-US/changelogs/13.txt similarity index 100% rename from metadata/android/en/changelogs/13.txt rename to metadata/android/en-US/changelogs/13.txt diff --git a/metadata/android/en/changelogs/14.txt b/metadata/android/en-US/changelogs/14.txt similarity index 100% rename from metadata/android/en/changelogs/14.txt rename to metadata/android/en-US/changelogs/14.txt diff --git a/metadata/android/en/changelogs/15.txt b/metadata/android/en-US/changelogs/15.txt similarity index 100% rename from metadata/android/en/changelogs/15.txt rename to metadata/android/en-US/changelogs/15.txt diff --git a/metadata/android/en/changelogs/16.txt b/metadata/android/en-US/changelogs/16.txt similarity index 100% rename from metadata/android/en/changelogs/16.txt rename to metadata/android/en-US/changelogs/16.txt diff --git a/metadata/android/en/changelogs/17.txt b/metadata/android/en-US/changelogs/17.txt similarity index 100% rename from metadata/android/en/changelogs/17.txt rename to metadata/android/en-US/changelogs/17.txt diff --git a/metadata/android/en/changelogs/18.txt b/metadata/android/en-US/changelogs/18.txt similarity index 100% rename from metadata/android/en/changelogs/18.txt rename to metadata/android/en-US/changelogs/18.txt diff --git a/metadata/android/en/changelogs/19.txt b/metadata/android/en-US/changelogs/19.txt similarity index 100% rename from metadata/android/en/changelogs/19.txt rename to metadata/android/en-US/changelogs/19.txt diff --git a/metadata/android/en/changelogs/20.txt b/metadata/android/en-US/changelogs/20.txt similarity index 100% rename from metadata/android/en/changelogs/20.txt rename to metadata/android/en-US/changelogs/20.txt diff --git a/metadata/android/en/changelogs/21.txt b/metadata/android/en-US/changelogs/21.txt similarity index 100% rename from metadata/android/en/changelogs/21.txt rename to metadata/android/en-US/changelogs/21.txt diff --git a/metadata/android/en/changelogs/22.txt b/metadata/android/en-US/changelogs/22.txt similarity index 100% rename from metadata/android/en/changelogs/22.txt rename to metadata/android/en-US/changelogs/22.txt diff --git a/metadata/android/en/changelogs/23.txt b/metadata/android/en-US/changelogs/23.txt similarity index 100% rename from metadata/android/en/changelogs/23.txt rename to metadata/android/en-US/changelogs/23.txt diff --git a/metadata/android/en/changelogs/24.txt b/metadata/android/en-US/changelogs/24.txt similarity index 100% rename from metadata/android/en/changelogs/24.txt rename to metadata/android/en-US/changelogs/24.txt diff --git a/metadata/android/en/changelogs/25.txt b/metadata/android/en-US/changelogs/25.txt similarity index 100% rename from metadata/android/en/changelogs/25.txt rename to metadata/android/en-US/changelogs/25.txt diff --git a/metadata/android/en/changelogs/26.txt b/metadata/android/en-US/changelogs/26.txt similarity index 100% rename from metadata/android/en/changelogs/26.txt rename to metadata/android/en-US/changelogs/26.txt diff --git a/metadata/android/en/changelogs/27.txt b/metadata/android/en-US/changelogs/27.txt similarity index 100% rename from metadata/android/en/changelogs/27.txt rename to metadata/android/en-US/changelogs/27.txt diff --git a/metadata/android/en/changelogs/28.txt b/metadata/android/en-US/changelogs/28.txt similarity index 100% rename from metadata/android/en/changelogs/28.txt rename to metadata/android/en-US/changelogs/28.txt diff --git a/metadata/android/en/changelogs/29.txt b/metadata/android/en-US/changelogs/29.txt similarity index 100% rename from metadata/android/en/changelogs/29.txt rename to metadata/android/en-US/changelogs/29.txt diff --git a/metadata/android/en/changelogs/30.txt b/metadata/android/en-US/changelogs/30.txt similarity index 100% rename from metadata/android/en/changelogs/30.txt rename to metadata/android/en-US/changelogs/30.txt diff --git a/metadata/android/en/changelogs/31.txt b/metadata/android/en-US/changelogs/31.txt similarity index 100% rename from metadata/android/en/changelogs/31.txt rename to metadata/android/en-US/changelogs/31.txt diff --git a/metadata/android/en/changelogs/32.txt b/metadata/android/en-US/changelogs/32.txt similarity index 100% rename from metadata/android/en/changelogs/32.txt rename to metadata/android/en-US/changelogs/32.txt diff --git a/metadata/android/en/changelogs/33.txt b/metadata/android/en-US/changelogs/33.txt similarity index 100% rename from metadata/android/en/changelogs/33.txt rename to metadata/android/en-US/changelogs/33.txt diff --git a/metadata/android/en/changelogs/34.txt b/metadata/android/en-US/changelogs/34.txt similarity index 100% rename from metadata/android/en/changelogs/34.txt rename to metadata/android/en-US/changelogs/34.txt diff --git a/metadata/android/en/changelogs/35.txt b/metadata/android/en-US/changelogs/35.txt similarity index 100% rename from metadata/android/en/changelogs/35.txt rename to metadata/android/en-US/changelogs/35.txt diff --git a/metadata/android/en/changelogs/36.txt b/metadata/android/en-US/changelogs/36.txt similarity index 100% rename from metadata/android/en/changelogs/36.txt rename to metadata/android/en-US/changelogs/36.txt diff --git a/metadata/android/en/changelogs/37.txt b/metadata/android/en-US/changelogs/37.txt similarity index 100% rename from metadata/android/en/changelogs/37.txt rename to metadata/android/en-US/changelogs/37.txt diff --git a/metadata/android/en/changelogs/38.txt b/metadata/android/en-US/changelogs/38.txt similarity index 100% rename from metadata/android/en/changelogs/38.txt rename to metadata/android/en-US/changelogs/38.txt diff --git a/metadata/android/en/changelogs/39.txt b/metadata/android/en-US/changelogs/39.txt similarity index 100% rename from metadata/android/en/changelogs/39.txt rename to metadata/android/en-US/changelogs/39.txt diff --git a/metadata/android/en/full_description.txt b/metadata/android/en-US/full_description.txt similarity index 100% rename from metadata/android/en/full_description.txt rename to metadata/android/en-US/full_description.txt diff --git a/metadata/android/en/images/featureGraphic.png b/metadata/android/en-US/images/featureGraphic.png similarity index 100% rename from metadata/android/en/images/featureGraphic.png rename to metadata/android/en-US/images/featureGraphic.png diff --git a/metadata/android/en/images/icon.png b/metadata/android/en-US/images/icon.png similarity index 100% rename from metadata/android/en/images/icon.png rename to metadata/android/en-US/images/icon.png diff --git a/metadata/android/en/images/phoneScreenshots/1.png b/metadata/android/en-US/images/phoneScreenshots/1.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/1.png rename to metadata/android/en-US/images/phoneScreenshots/1.png diff --git a/metadata/android/en/images/phoneScreenshots/2.png b/metadata/android/en-US/images/phoneScreenshots/2.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/2.png rename to metadata/android/en-US/images/phoneScreenshots/2.png diff --git a/metadata/android/en/images/phoneScreenshots/3.png b/metadata/android/en-US/images/phoneScreenshots/3.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/3.png rename to metadata/android/en-US/images/phoneScreenshots/3.png diff --git a/metadata/android/en/images/phoneScreenshots/4.png b/metadata/android/en-US/images/phoneScreenshots/4.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/4.png rename to metadata/android/en-US/images/phoneScreenshots/4.png diff --git a/metadata/android/en/images/phoneScreenshots/5.png b/metadata/android/en-US/images/phoneScreenshots/5.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/5.png rename to metadata/android/en-US/images/phoneScreenshots/5.png diff --git a/metadata/android/en/images/phoneScreenshots/6.png b/metadata/android/en-US/images/phoneScreenshots/6.png similarity index 100% rename from metadata/android/en/images/phoneScreenshots/6.png rename to metadata/android/en-US/images/phoneScreenshots/6.png diff --git a/metadata/android/en/short_description.txt b/metadata/android/en-US/short_description.txt similarity index 100% rename from metadata/android/en/short_description.txt rename to metadata/android/en-US/short_description.txt diff --git a/metadata/android/en/title.txt b/metadata/android/en-US/title.txt similarity index 100% rename from metadata/android/en/title.txt rename to metadata/android/en-US/title.txt diff --git a/metadata/android/en/video.txt b/metadata/android/en-US/video.txt similarity index 100% rename from metadata/android/en/video.txt rename to metadata/android/en-US/video.txt diff --git a/metadata/android/es/full_description.txt b/metadata/android/es-ES/full_description.txt similarity index 100% rename from metadata/android/es/full_description.txt rename to metadata/android/es-ES/full_description.txt diff --git a/metadata/android/es/short_description.txt b/metadata/android/es-ES/short_description.txt similarity index 100% rename from metadata/android/es/short_description.txt rename to metadata/android/es-ES/short_description.txt diff --git a/metadata/android/es/title.txt b/metadata/android/es-ES/title.txt similarity index 100% rename from metadata/android/es/title.txt rename to metadata/android/es-ES/title.txt diff --git a/metadata/android/fa/title.txt b/metadata/android/fa-IR/title.txt similarity index 100% rename from metadata/android/fa/title.txt rename to metadata/android/fa-IR/title.txt diff --git a/metadata/android/fr/full_description.txt b/metadata/android/fr-FR/full_description.txt similarity index 100% rename from metadata/android/fr/full_description.txt rename to metadata/android/fr-FR/full_description.txt diff --git a/metadata/android/fr/short_description.txt b/metadata/android/fr-FR/short_description.txt similarity index 100% rename from metadata/android/fr/short_description.txt rename to metadata/android/fr-FR/short_description.txt diff --git a/metadata/android/fr/title.txt b/metadata/android/fr-FR/title.txt similarity index 100% rename from metadata/android/fr/title.txt rename to metadata/android/fr-FR/title.txt diff --git a/metadata/android/it/short_description.txt b/metadata/android/it-IT/short_description.txt similarity index 100% rename from metadata/android/it/short_description.txt rename to metadata/android/it-IT/short_description.txt diff --git a/metadata/android/it/title.txt b/metadata/android/it-IT/title.txt similarity index 100% rename from metadata/android/it/title.txt rename to metadata/android/it-IT/title.txt diff --git a/metadata/android/ko/full_description.txt b/metadata/android/ko-KR/full_description.txt similarity index 95% rename from metadata/android/ko/full_description.txt rename to metadata/android/ko-KR/full_description.txt index 841990a..a047f11 100644 --- a/metadata/android/ko/full_description.txt +++ b/metadata/android/ko-KR/full_description.txt @@ -15,4 +15,4 @@ - 다중 레이아웃: QWERTY, QWERTZ, AZERTY. 다양한 테마: White, Dark, OLED Black. 또한 다른 많은 옵션들. 다른 가상 키보드와 마찬가지로 시스템 설정에서 활성화해야 합니다. 시스템 설정을 열고 다음으로 이동합니다. -시스템 > 언어 및 입력 > 키보드 > 키보드 관리. +시스템 > 언어 및 입력 > 키보드 > 키보드 관리. \ No newline at end of file diff --git a/metadata/android/ko/short_description.txt b/metadata/android/ko-KR/short_description.txt similarity index 100% rename from metadata/android/ko/short_description.txt rename to metadata/android/ko-KR/short_description.txt diff --git a/metadata/android/ko/title.txt b/metadata/android/ko-KR/title.txt similarity index 100% rename from metadata/android/ko/title.txt rename to metadata/android/ko-KR/title.txt diff --git a/metadata/android/pl/full_description.txt b/metadata/android/pl-PL/full_description.txt similarity index 100% rename from metadata/android/pl/full_description.txt rename to metadata/android/pl-PL/full_description.txt diff --git a/metadata/android/pl/short_description.txt b/metadata/android/pl-PL/short_description.txt similarity index 100% rename from metadata/android/pl/short_description.txt rename to metadata/android/pl-PL/short_description.txt diff --git a/metadata/android/pl/title.txt b/metadata/android/pl-PL/title.txt similarity index 100% rename from metadata/android/pl/title.txt rename to metadata/android/pl-PL/title.txt diff --git a/metadata/android/pt/full_description.txt b/metadata/android/pt-BR/full_description.txt similarity index 100% rename from metadata/android/pt/full_description.txt rename to metadata/android/pt-BR/full_description.txt diff --git a/metadata/android/pt/short_description.txt b/metadata/android/pt-BR/short_description.txt similarity index 100% rename from metadata/android/pt/short_description.txt rename to metadata/android/pt-BR/short_description.txt diff --git a/metadata/android/pt/title.txt b/metadata/android/pt-BR/title.txt similarity index 100% rename from metadata/android/pt/title.txt rename to metadata/android/pt-BR/title.txt diff --git a/metadata/android/ru/full_description.txt b/metadata/android/ru-RU/full_description.txt similarity index 100% rename from metadata/android/ru/full_description.txt rename to metadata/android/ru-RU/full_description.txt diff --git a/metadata/android/ru/short_description.txt b/metadata/android/ru-RU/short_description.txt similarity index 100% rename from metadata/android/ru/short_description.txt rename to metadata/android/ru-RU/short_description.txt diff --git a/metadata/android/ru/title.txt b/metadata/android/ru-RU/title.txt similarity index 100% rename from metadata/android/ru/title.txt rename to metadata/android/ru-RU/title.txt diff --git a/metadata/android/tr/full_description.txt b/metadata/android/tr-TR/full_description.txt similarity index 100% rename from metadata/android/tr/full_description.txt rename to metadata/android/tr-TR/full_description.txt diff --git a/metadata/android/tr/short_description.txt b/metadata/android/tr-TR/short_description.txt similarity index 100% rename from metadata/android/tr/short_description.txt rename to metadata/android/tr-TR/short_description.txt diff --git a/metadata/android/tr/title.txt b/metadata/android/tr-TR/title.txt similarity index 100% rename from metadata/android/tr/title.txt rename to metadata/android/tr-TR/title.txt diff --git a/metadata/android/zh-rCN/title.txt b/metadata/android/zh-CN/title.txt similarity index 100% rename from metadata/android/zh-rCN/title.txt rename to metadata/android/zh-CN/title.txt diff --git a/sync_translations.py b/sync_translations.py index ec696c9..58a356c 100644 --- a/sync_translations.py +++ b/sync_translations.py @@ -6,6 +6,27 @@ import glob, os # - Remove obsolete strings # - Sort in the same order as the baseline # The baseline is 'values/strings.xml', which is english. +# Sync store title and descriptions to the 'metadata/' directory. + +VALUE_DIR_TO_METADATA = { + "cs": "cs-CZ", + "de": "de-DE", + "en": "en-US", + "es": "es-ES", + "fa": "fa-IR", + "fr": "fr-FR", + "it": "it-IT", + "ko": "ko-KR", + "lv": "lv", + "pl": "pl-PL", + "pt": "pt-BR", + "ro": "ro", + "ru": "ru-RU", + "tr": "tr-TR", + "uk": "uk", + "vi": "vi", + "zh-rCN": "zh-CN", + } # Dict of strings. Key is the pair string name and product field (often None). def parse_strings_file(file): @@ -38,8 +59,11 @@ def sync(baseline, strings): (key, base_string, True) for key, base_string in baseline.items() ] -def sync_metadata(locale, strings): - meta_dir = "metadata/android/" + locale +def sync_metadata(value_dir, strings): + locale = os.path.basename(value_dir).removeprefix("values-") + if not locale in VALUE_DIR_TO_METADATA: + raise Exception("Locale '%s' not known, please add it into sync_translations.py" % locale) + meta_dir = "metadata/android/" + VALUE_DIR_TO_METADATA[locale] def sync_meta_file(fname, string_name): if string_name in strings: string = strings[string_name] @@ -62,8 +86,7 @@ for value_dir in glob.glob("res/values-*"): synced_strings = sync(baseline, local_strings) with open(strings_file, "w", encoding="utf-8") as out: write_updated_strings(out, synced_strings) - locale = os.path.basename(value_dir).removeprefix("values-") - sync_metadata(locale, local_strings) + sync_metadata(value_dir, local_strings) print_status(strings_file, synced_strings) sync_metadata("en", baseline)