Skip to content

Repo: Crowdin translations support #63

Description

@marcuspollio

Add support for translating via Crowding service

crowdin.yml (example):

project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
base_path_env: CROWDIN_BASE_PATH
base_url_env: CROWDIN_BASE_URL

preserve_hierarchy: true

files:
  - source: /content/en/**/*.md
    translation: /content/%two_letters_code%/%original_path%

  - source: /themes/trigo/i18n/en.yaml
    translation: /themes/trigo/i18n/%two_letters_code%.yaml

.github/workflows/crowdin.yaml (example):

name: Crowdin

on:
  push:
    branches:
      - main

  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  crowdin:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0

      - name: Synchronize with Crowdin
        uses: crowdin/github-action@v2
        with:
          upload_sources: true
          upload_translations: true
          download_translations: true
          create_pull_request: true
          localization_branch_name: crowdin
          pull_request_title: "i18n: Update translations from Crowdin"
          pull_request_body: "Automated translation update by Crowdin GH Action."
          pull_request_base_branch_name: main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
          CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :octocat:FeatureImprovement idea or feature requestToolsTools helping for content generation, workflow, and maintenance.github_actionsPull requests that update GitHub Actions code

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions