diff options
author | Volker Krause <vkrause@kde.org> | 2021-05-07 16:44:09 +0200 |
---|---|---|
committer | Volker Krause <vkrause@kde.org> | 2021-05-07 16:44:09 +0200 |
commit | 93824294f5a987200b86f62bad839616f79481e5 (patch) | |
tree | b299537dd22b58cf353ab26d63ca153f8930569d /toolchain | |
parent | bf5269dfdd94d63d72eb7725f1d3ea3d270d034d (diff) | |
download | extra-cmake-modules-93824294f5a987200b86f62bad839616f79481e5.tar.gz extra-cmake-modules-93824294f5a987200b86f62bad839616f79481e5.tar.bz2 |
Extend Android language mappings for translated metadata
This is likely still not complete, but with this at least most of
Itinerary's metadata translations are accepted during upload to the
Google Play store (the remaining ones are rejected for different reasons).
F-Droid seems considerably less picky about this, and works with either
form.
Diffstat (limited to 'toolchain')
-rwxr-xr-x | toolchain/generate-fastlane-metadata.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/toolchain/generate-fastlane-metadata.py b/toolchain/generate-fastlane-metadata.py index bd5b8d44..911058f8 100755 --- a/toolchain/generate-fastlane-metadata.py +++ b/toolchain/generate-fastlane-metadata.py @@ -25,9 +25,29 @@ import yaml import zipfile # Constants used in this script +# map KDE's translated language codes to those expected by Android +# see https://f-droid.org/en/docs/Translation_and_Localization/ +# F-Droid is more tolerant than the Play Store here, the latter rejects anything not exactly matching its known codes +# Android does do the expected fallbacks, so the seemingly "too specific" mappings here are still working as expected +# see https://developer.android.com/guide/topics/resources/multilingual-support#resource-resolution-examples languageMap = { None: "en-US", - "ca": "ca-ES" + "ca-valencia": None, # not supported by Android + "cs": "cs-CZ", + "de": "de-DE", + "es": "es-ES", + "eu": "eu-ES", + "fi": "fi-FI", + "fr": "fr-FR", + "gl": "gl-ES", + "ia": None, # not supported by Android + "it": "it-IT", + "ko": "ko-KR", + "nl": "nl-NL", + "pl": "pl-PL", + "pt": "pt-PT", + "ru": "ru-RU", + "sv": "sv-SE" } # see https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/ @@ -74,6 +94,8 @@ def createFastlaneFile( applicationName, filenameToPopulate, fileContent ): for lang, text in fileContent.items(): # First, do we need to amend the language id, to turn the Android language ID into something more F-Droid/Fastlane friendly? languageCode = languageMap.get(lang, lang) + if not languageCode: + continue # Next we need to determine the path to the directory we're going to be writing the data into repositoryBasePath = arguments.output |