Translate strings #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Translate general strings | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
formatCode: | |
name: DeepL translation job | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Translate shared/presentation/src/commonMain/composeResources/values/strings.xml to supported languages | |
run: | | |
python translator.py \ | |
--api_key $API_KEY \ | |
--output_languages $OUTPUT_LANGUAGES \ | |
--input_folder $INPUT_FOLDER | |
env: | |
API_KEY: ${{ secrets.DEEPL_API_KEY }} | |
OUTPUT_LANGUAGES: "ES,FR,DE,ZH,UK,JA,RU,AR,PT,IT,KO,NL,SV,PL,TR,DA,FI,EL,HU" | |
INPUT_FOLDER: "./shared/presentation/src/commonMain/composeResources/values" | |
- name: Translate androidApp/src/main/res/values/strings.xml to supported languages | |
run: | | |
python translator.py \ | |
--api_key $API_KEY \ | |
--output_languages $OUTPUT_LANGUAGES \ | |
--input_folder $INPUT_FOLDER | |
env: | |
API_KEY: ${{ secrets.DEEPL_API_KEY }} | |
OUTPUT_LANGUAGES: "ES,FR,DE,ZH,UK,JA,RU,AR,PT,IT,KO,NL,SV,PL,TR,DA,FI,EL,HU" | |
INPUT_FOLDER: "./androidApp/src/main/res/values" | |
- name: Add common strings.xml to Git | |
run: git add androidApp/src/main/res/values* | |
- name: Commit files | |
run: | | |
git config --local user.email ${{ vars.COMMITER_EMAIL }} | |
git config --local user.name ${{ vars.COMMITER_NAME }} | |
git commit -a -m "Github Action automatic translation of android specific strings" | |
- name: GitHub Push | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |