From b1b8916a031b64194fc198b8c9354a16286b54aa Mon Sep 17 00:00:00 2001 From: Stefan Wendhausen Date: Sun, 21 Jul 2024 16:35:03 +0200 Subject: [PATCH 1/2] Added Crowdin support for managing translations --- .github/workflows/crowdin-wf.yml | 53 +++++++++++++++++++++ crowdin.yml | 79 ++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 .github/workflows/crowdin-wf.yml create mode 100644 crowdin.yml diff --git a/.github/workflows/crowdin-wf.yml b/.github/workflows/crowdin-wf.yml new file mode 100644 index 00000000000..ccc3337283c --- /dev/null +++ b/.github/workflows/crowdin-wf.yml @@ -0,0 +1,53 @@ +name: Crowdin Action +# Controls when the action will run. +on: + schedule: + - cron: '30 * * * *' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + synchronize-with-crowdin: + if: (github.event_name == 'schedule' && github.repository == 'joomla-extensions/weblinks') || (github.event_name != 'schedule') + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout + uses: actions/checkout@v4 + + # Runs the Crowdin action command - https://github.com/crowdin/github-action + - name: crowdin action + uses: crowdin/github-action@v1.20.4 + with: + # Upload sources to Crowdin + upload_sources: true + # Upload translations to Crowdin, only use true at initial run + upload_translations: false + # Make pull request of Crowdin translations + download_translations: true + # Only download translated strings + skip_untranslated_strings: false + # Download translations with pushing to branch + push_translations: true + # To download translations to the specified version branch + localization_branch_name: 'l10n_crowdin_translations' + # Create pull request after pushing to branch + create_pull_request: true + # Configuration file to use + config: 'crowdin.yml' + # Use true for dryrun to test the run without actually processing anything + dryrun_action: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000000..cf8f4a8c758 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,79 @@ +# Project Public Identifier: joomla-official-extensions +project_id_env: CROWDIN_PROJECT_ID # The numeric project ID. +api_token_env: CROWDIN_PERSONAL_TOKEN +base_path: ".." +base_url: "https://joomla.crowdin.com" + +preserve_hierarchy: true + +files: + - source: /src/administrator/language/en-GB/en-GB.com_weblinks.ini + dest: 'Weblinks/administrator/language/en-GB.com_weblinks.ini' + translation: /administrator/language/%locale%/%locale%.com_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini + dest: 'Weblinks/administrator/language/en-GB.com_weblinks.sys.ini' + translation: /administrator/language/%locale%/%locale%.com_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/language/en-GB/en-GB.com_weblinks.ini + dest: 'Weblinks/language/en-GB.com_weblinks.ini' + translation: /language/%locale%/%locale%.com_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/language/en-GB/en-GB.mod_weblinks.ini + dest: 'Weblinks/language/en-GB.mod_weblinks.ini' + translation: /language/%locale%/%locale%.mod_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/language/en-GB/en-GB.mod_weblinks.sys.ini + dest: 'Weblinks/language/en-GB.mod_weblinks.sys.ini' + translation: /language/%locale%/%locale%.mod_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/language/en-GB/en-GB.pkg_weblinks.sys.ini + dest: 'Weblinks/language/en-GB.pkg_weblinks.sys.ini' + translation: /language/%locale%/%locale%.pkg_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/editors-xtd/weblink/language/en-GB/en-GB.plg_editors-xtd_weblink.ini + dest: 'Weblinks/plugins/editors-xtd/weblink/language/en-GB.plg_editors-xtd_weblink.ini' + translation: /plugins/editors-xtd/weblink/language/%locale%/%locale%.plg_editors-xtd_weblink.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/editors-xtd/weblink/language/en-GB/en-GB.plg_editors-xtd_weblink.sys.ini + dest: 'Weblinks/plugins/editors-xtd/weblink/language/en-GB.plg_editors-xtd_weblink.sys.ini' + translation: /plugins/editors-xtd/weblink/language/%locale%/%locale%.plg_editors-xtd_weblink.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/finder/weblinks/language/en-GB/en-GB.plg_finder_weblinks.ini + dest: 'Weblinks/plugins/finder/weblinks/language/en-GB.plg_finder_weblinks.ini' + translation: /plugins/finder/weblinks/language/%locale%/%locale%.plg_finder_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/finder/weblinks/language/en-GB/en-GB.plg_finder_weblinks.sys.ini + dest: 'Weblinks/plugins/finder/weblinks/language/en-GB.plg_finder_weblinks.sys.ini' + translation: /plugins/finder/weblinks/language/%locale%/%locale%.plg_finder_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/search/weblinks/language/en-GB/en-GB.plg_search_weblinks.ini + dest: 'Weblinks/plugins/search/weblinks/language/en-GB.plg_search_weblinks.ini' + translation: /plugins/search/weblinks/language/%locale%/%locale%.plg_search_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/search/weblinks/language/en-GB/en-GB.plg_search_weblinks.sys.ini + dest: 'Weblinks/plugins/search/weblinks/language/en-GB.plg_search_weblinks.sys.ini' + translation: /plugins/search/weblinks/language/%locale%/%locale%.plg_search_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini + dest: 'Weblinks/plugins/system/weblinks/language/en-GB.plg_system_weblinks.ini' + translation: /plugins/system/weblinks/language/%locale%/%locale%.plg_system_weblinks.ini + type: joomla + update_option: update_as_unapproved + - source: /src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.sys.ini + dest: 'Weblinks/plugins/system/weblinks/language/en-GB.plg_system_weblinks.sys.ini' + translation: /plugins/system/weblinks/language/%locale%/%locale%.plg_system_weblinks.sys.ini + type: joomla + update_option: update_as_unapproved From 1d6ac1941330c030e7822e161697b3c6ef2ed61e Mon Sep 17 00:00:00 2001 From: Stefan Wendhausen Date: Wed, 31 Jul 2024 12:50:55 +0200 Subject: [PATCH 2/2] Update crowdin.yml Co-authored-by: Tobias Zulauf --- crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crowdin.yml b/crowdin.yml index cf8f4a8c758..450c55f7f95 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -9,7 +9,7 @@ preserve_hierarchy: true files: - source: /src/administrator/language/en-GB/en-GB.com_weblinks.ini dest: 'Weblinks/administrator/language/en-GB.com_weblinks.ini' - translation: /administrator/language/%locale%/%locale%.com_weblinks.ini + translation: /administrator/language/%locale%/com_weblinks.ini type: joomla update_option: update_as_unapproved - source: /src/administrator/language/en-GB/en-GB.com_weblinks.sys.ini