Add Crowdin config file and update crowdin-cli

This commit is contained in:
mimi89999 2025-03-19 09:43:56 +01:00
parent 19fe7bd4d2
commit 8b5b1e6ed2
No known key found for this signature in database
GPG key ID: 4B054AC4922D7B18
3 changed files with 21 additions and 17 deletions

View file

@ -1,10 +0,0 @@
project_id: "372633"
api_token: "<api-token-here>"
base_path: "../app/src/main"
base_url: "https://api.crowdin.com"
preserve_hierarchy: true
files:
- source: "res/values/strings.xml"
dest: "strings.xml"
translation: "res/values-%android_code%/%original_file_name%"

View file

@ -13,19 +13,15 @@ jobs:
- uses: actions/checkout@v4
- name: Install crowdin-cli
run: |
wget https://github.com/crowdin/crowdin-cli/releases/download/3.7.2/crowdin-cli.zip
echo "ee9f838b819ccedc33c9b2537055e5ba7d7934561b24df1e1a6274cbd6e27f2d crowdin-cli.zip" | sha256sum -c
wget https://github.com/crowdin/crowdin-cli/releases/download/4.6.1/crowdin-cli.zip
echo "7afd70de3a747ac631a5bad7866008163ae1d50c4606b5773f0b90a5481ffde2 crowdin-cli.zip" | sha256sum -c
unzip crowdin-cli.zip -d crowdin-cli
- name: Upload to Crowdin
env:
CROWDIN_TOKEN: "${{ secrets.CROWDIN_TOKEN }}"
run: |
java -jar ./crowdin-cli/3.7.2/crowdin-cli.jar upload sources \
java -jar ./crowdin-cli/4.6.1/crowdin-cli.jar upload sources \
--no-progress \
--token "$CROWDIN_TOKEN" \
--project-id 372633 \
--base-path app/src/main \
--source res/values/strings.xml \
--translation "res/values-%android_code%/%original_file_name%" \
--dest strings.xml \
--branch master

18
crowdin.yml Normal file
View file

@ -0,0 +1,18 @@
"base_path": "app/src/main"
"preserve_hierarchy": true
"files": [
{
"source": "res/values/strings.xml",
"dest": "strings.xml",
"translation": "res/values-%android_code%/%original_file_name%",
"type": "android"
},
{
"source": "res/values-v29/strings.xml",
"dest": "strings-v29.xml",
"translation": "res/values-%android_code%-v29/%original_file_name%",
"type": "android"
}
]