FreeCAD / FreeCAD/Website

Repo: Crowdin translations support

Open
#63 3 comments 0 reactions 0 assignees View on GitHub
:octocat: Feature github_actions Tools
Dominant language
HTML
Stars
3
Forks
5
Avg merge
2d 7h
Merged PRs (30d)
8

Description

Add support for translating via Crowding service

- https://support.crowdin.com/github-integration/
- https://crowdin.github.io/crowdin-cli/configuration
- https://github.com/crowdin/github-action

`crowdin.yml` (example):
```yaml
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):
```yaml
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 }}
```

Contributor guide

Open the contributing guide

Research direction

Start by checking the existing content/en/**/*.md and themes/trigo/i18n/en.yaml paths, then compare the issue's crowdin.yml and .github/workflows/crowdin.yaml examples with the repository layout. Configure source and translation paths and the Crowdin workflow using the listed secrets. Done means the workflow can synchronize translations and create the described localization pull request.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, markdown, yaml
Domain
ci-cd, localization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.