From 6afaaf37c9e5475afd52a8c87b9e3fbd8c484c7b Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 28 Mar 2024 05:35:19 +0100 Subject: [PATCH] feat(translate_apps): add message to the PR --- .../apps_translations_to_apps.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/translate_apps/apps_translations_to_apps.py b/tools/translate_apps/apps_translations_to_apps.py index 1f5ed1ab..60c0f489 100644 --- a/tools/translate_apps/apps_translations_to_apps.py +++ b/tools/translate_apps/apps_translations_to_apps.py @@ -156,7 +156,7 @@ def extract_strings_to_translate_from_apps(apps, translations_repository): # if no PR exist, create one if not repository.run_command("hub pr list -h manifest_toml_i18n", capture_output=True): - repository.run_command(["hub", "pull-request", "-m", "Update translations for manifest.toml", "-b", branch, "-h", "manifest_toml_i18n", "-p"]) + repository.run_command(["hub", "pull-request", "-m", "Update translations for manifest.toml", "-b", branch, "-h", "manifest_toml_i18n", "-p", "-m", f"This pull request is automatically generated by scripts from the [YunoHost/apps](https://github.com/YunoHost/apps) repository.\n\nThe translation is pull from weblate and is located here: https://translate.yunohost.org/projects/yunohost-apps/{app}/\n\nIf you wish to modify the translation (other than in english), please do that directly on weblate since this is now the source of authority for it.\n\nDon't hesitate to reach the YunoHost team on [matrix](https://matrix.to/#/#yunohost:matrix.org) if there is any problem :heart:"]) time.sleep(2) @@ -168,3 +168,21 @@ if __name__ == "__main__": f"https://{login}:{token}@github.com/yunohost/apps_translations", "main" ) as repository: extract_strings_to_translate_from_apps(apps, repository) + if not repository.run_command( + "hub pr list -h manifest_toml_i18n", capture_output=True + ): + repository.run_command( + [ + "hub", + "pull-request", + "-m", + "Update translations for manifest.toml", + "-b", + branch, + "-h", + "manifest_toml_i18n", + "-p", + "-m", + f"This pull request is automatically generated by scripts from the [YunoHost/apps](https://github.com/YunoHost/apps) repository.\n\nThe translation is pull from weblate and is located here: https://translate.yunohost.org/projects/yunohost-apps/{app}/\n\nIf you wish to modify the translation (other than in english), please do that directly on weblate since this is now the source of authority for it.\n\nDon't hesitate to reach the YunoHost team on [matrix](https://matrix.to/#/#yunohost:matrix.org) if there is any problem :heart:", + ] + )