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..450c55f7f95 --- /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%/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