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

refactor(translate_apps): move translations in a manifest subfolder

This commit is contained in:
Laurent Peuch 2024-03-28 05:35:24 +01:00 committed by OniriCorpe
parent 6afaaf37c9
commit 4b1454d04c
2 changed files with 5 additions and 3 deletions

View file

@ -106,12 +106,14 @@ def extract_strings_to_translate_from_apps(apps, translations_repository):
print(app)
print(f"{repository_uri} -> branch '{branch}'")
translations_path = Path(f"translations/apps/{app}/")
translations_path = Path(f"translations/apps/{app}/manifest/")
if not translations_repository.file_exists(translations_path):
print(f"App {app} doesn't have translations on github.com/yunohost/apps_translations, skip")
continue
translations_path = translations_repository.path / translations_path
with Repository(
f"https://{login}:{token}@github.com/{repository_uri}", branch
) as repository:
@ -120,7 +122,7 @@ def extract_strings_to_translate_from_apps(apps, translations_repository):
manifest = tomlkit.loads(repository.read_file("manifest.toml"))
for translation in (translations_repository.path / f"translations/apps/{app}/").glob("*.json"):
for translation in translations_path.glob("*.json"):
language = translation.name[:-len(".json")]
# english version is the base, never modify it

View file

@ -118,7 +118,7 @@ def extract_strings_to_translate_from_apps(apps, translations_repository):
manifest = tomlkit.loads(repository.read_file("manifest.toml"))
translations_path = Path(f"translations/apps/{app}/")
translations_path = Path(f"translations/apps/{app}/manifest/")
newly_created_translation = False
if not translations_repository.file_exists(translations_path):