1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

feat(translate_apps): handle also updating translation description on existing files

This commit is contained in:
Laurent Peuch 2024-03-31 06:46:07 +02:00 committed by OniriCorpe
parent b694ee9c38
commit b5771aeefc

View file

@ -107,6 +107,9 @@ def extract_strings_to_translate_from_apps(apps, translations_repository):
else: # if it exists, only add keys that aren't already present
language_file = json.loads(translations_repository.read_file(translations_path / f"{language}.json"))
if "description" in translated_strings and "description" not in language_file:
language_file["description"] = translated_strings["description"]
for key, translated_string in translated_strings.items():
if key not in language_file:
language_file[key] = translated_string