Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Crowdin support for managing translations #554

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/crowdin-wf.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
79 changes: 79 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -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