diff options
| author | Patrick | 2026-05-07 20:16:23 +0200 |
|---|---|---|
| committer | Patrick | 2026-05-07 20:16:23 +0200 |
| commit | b866f59e400973c2f7ba0e97517fdddeb3efbb33 (patch) | |
| tree | 20c702893298303445e4513de78a9fd83ca5bf94 /sync_translations.py | |
| parent | 5cfb4e328e4985f9ea7c145a76938f48e9df6fef (diff) | |
| parent | b807f217a06d3312e05a25c23342f41d339e76c6 (diff) | |
| download | unexpected-keyboard-b866f59e400973c2f7ba0e97517fdddeb3efbb33.tar.gz unexpected-keyboard-b866f59e400973c2f7ba0e97517fdddeb3efbb33.zip | |
Merge branch 'master' into skintones
Diffstat (limited to 'sync_translations.py')
| -rw-r--r-- | sync_translations.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sync_translations.py b/sync_translations.py index 3d0ab7d..3532a27 100644 --- a/sync_translations.py +++ b/sync_translations.py @@ -8,12 +8,19 @@ import glob, os, sys # The baseline is 'values/strings.xml', which is english. # Sync store title and descriptions to the metadata directory. +# Map language codes to the codes that Google Play understands. Languages +# mapped to [None] are not supported by Google Play. VALUE_DIR_TO_METADATA = { + "ar": "ar", + "ars": None, + "arz": None, + "bn-rBD": None, + "ca": "ca", "cs": "cs-CZ", "de": "de-DE", "en": "en-US", "es": "es-ES", - "fa": "fa-IR", + "fa": None, "fil": "fil", "fr": "fr-FR", "in": "id", @@ -21,15 +28,19 @@ VALUE_DIR_TO_METADATA = { "ja": "ja-JP", "ko": "ko-KR", "lv": "lv", + "my": None, "nl": "nl-NL", "pl": "pl-PL", "pt": "pt-BR", "ro": "ro", "ru": "ru-RU", + "th": "th", + "tok": None, "tr": "tr-TR", "uk": "uk", "vi": "vi", "zh-rCN": "zh-CN", + "zh-rTW": "zh-TW", } # Dict of strings. Key is the pair string name and product field (often None). @@ -69,7 +80,10 @@ 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 = "fastlane/metadata/android/" + VALUE_DIR_TO_METADATA[locale] + metadata_name = VALUE_DIR_TO_METADATA[locale] + if metadata_name == None: + return # Not supported by the play store + meta_dir = "fastlane/metadata/android/" + metadata_name def sync_meta_file(fname, string_name): if string_name in strings: string = strings[string_name] |
