Add Crowdin localization workflow and configuration

This commit introduces a new GitHub workflow for synchronizing with Crowdin, including configuration files for uploading sources and managing translations.
pull/1798/head
James Rich 2025-04-29 10:43:33 -05:00
rodzic 0f9f00843f
commit e7a76ba156
2 zmienionych plików z 72 dodań i 0 usunięć

36
.github/workflows/crowdin.yml vendored 100644
Wyświetl plik

@ -0,0 +1,36 @@
name: Crowdin Action
on:
push:
branches: [ master ]
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Synchronize with Crowdin
uses: crowdin/github-action@v2
with:
config: 'config/crowdin/crowdin.yml'
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: 'chore(l10n): New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'master'
crowdin_branch_name: 'master'
env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

Wyświetl plik

@ -0,0 +1,36 @@
#
# Basic Crowdin CLI configuration
# See https://crowdin.github.io/crowdin-cli/configuration for more information
# See https://support.crowdin.com/developer/configuration-file/ for all available options
#
#
# Crowdin credentials
#
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://meshtastic.api.crowdin.com"
#
# Defines whether to preserve the original directory structure in the Crowdin project
# Recommended to set to true
#
"preserve_hierarchy": false
#
# Files configuration.
# See https://support.crowdin.com/developer/configuration-file/ for all available options
#
"files": [
{
"source": "/**/values/strings.xml",
"translation": "/**/values-%two_letters_code%/%original_file_name%",
"translation_replace": {
"sr-Latn": "b+sr+Latn",
},
"update_strings": true,
"cleanup_mode": true,
"escape_special_characters": 1
}
]