From 93824294f5a987200b86f62bad839616f79481e5 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Fri, 7 May 2021 16:44:09 +0200 Subject: 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. --- toolchain/generate-fastlane-metadata.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'toolchain/generate-fastlane-metadata.py') 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 -- cgit v1.2.1