Skip to content
Wilco Alsemgeest edited this page Dec 21, 2020 · 12 revisions

Support Sources

Crowdin Yaml file example

This file must be named "crowdin.yml" and be in the root of the repository. Other locations is also possible, but requires a change in the workflow file.

"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"project_id" : "Number"
"base_path" : "language"
"base_url" : "https://joomla.crowdin.com"

"preserve_hierarchy": true

"files": [
  {
    "source" : "/en-GB/en-GB.com_language.ini",
    "dest" : "Joomla! Folder/en-GB.com_language.ini",
    "translation" : "/%locale%/%locale%.com_language.ini"
  },
  {
    "source" : "/en-GB/en-GB.com_language2.ini",
    "dest" : "Joomla! Folder/en-GB.com_language2.ini",
    "translation" : "/%locale%/%locale%.com_language2.ini"
  },
  {
    "source" : "/en-GB/en-GB.com_language3.ini",
    "dest" : "Joomla! Folder/en-GB.com_language3.ini",
    "translation" : "/%locale%/%locale%.com_language3.ini"
  }
]

Github Actions workflow file example

This file is used within the the Github Actions configuration.

name: Crowdin Action
# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# 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:
    # 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@v2
    
    # Runs the Crowdin action command
    - name: crowdin action
      # Version of the Crowdin Github action to use
      uses: crowdin/[email protected]
      with:
        # upload options
        upload_sources: true
        # upload translations options
        upload_translations: true
        # download translations options
        download_translations: true
        push_translations: true
        localization_branch_name: 'l10n_crowdin_translations'
        create_pull_request: true
        # Configuration file to use
        config: 'crowdin.yml'
        # Use false for dryrun to stop testing and really use it
        dryrun_action: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

Github Repostitory secret

Go to "Settings" - "Secrets" - "New repository secret"
Use name: CROWDIN_PERSONAL_TOKEN
Use value: Received from Crowdin project manager

Clone this wiki locally