-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
another iteration on the translator script, this time allowing iOS sp…
…ecific translations
- Loading branch information
Javier Manrique
committed
Nov 24, 2024
1 parent
9eca69e
commit cdb4230
Showing
2 changed files
with
134 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
name: Translate general strings | ||
name: Translate strings | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
platform: | ||
description: 'Platform to translate strings for' | ||
required: true | ||
default: 'all' | ||
type: choice | ||
options: | ||
- all | ||
- android | ||
- common | ||
- ios | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -18,36 +29,65 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Translate shared/presentation/src/commonMain/composeResources/values/strings.xml to supported languages | ||
- name: Translate common strings to supported languages | ||
if: ${{ github.event.inputs.platform == 'common' || github.event.inputs.platform == 'all' }} | ||
run: | | ||
python translator.py \ | ||
--api_key $API_KEY \ | ||
--output_languages $OUTPUT_LANGUAGES \ | ||
--input_folder $INPUT_FOLDER | ||
--input_folder $INPUT_FOLDER \ | ||
--platform $PLATFORM | ||
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" | ||
PLATFORM: "common" | ||
|
||
- name: Translate shared/presentation/src/androidMain/res/values/strings.xml to supported languages | ||
- name: Translate android strings to supported languages | ||
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }} | ||
run: | | ||
python translator.py \ | ||
--api_key $API_KEY \ | ||
--output_languages $OUTPUT_LANGUAGES \ | ||
--input_folder $INPUT_FOLDER | ||
--platform $PLATFORM | ||
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/androidMain/res/values" | ||
PLATFORM: "android" | ||
|
||
- name: Translate iOS strings to supported languages | ||
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'all' }} | ||
run: | | ||
python translator.py \ | ||
--api_key $API_KEY \ | ||
--output_languages $OUTPUT_LANGUAGES \ | ||
--input_folder $INPUT_FOLDER | ||
--platform $PLATFORM | ||
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: "./iosApp" | ||
PLATFORM: "ios" | ||
|
||
- name: Add common strings to Git | ||
if: ${{ github.event.inputs.platform == 'common' || github.event.inputs.platform == 'all' }} | ||
run: git add shared/presentation/src/commonMain/composeResources/values* | ||
|
||
- name: Add common strings.xml to Git | ||
- name: Add android strings to Git | ||
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }} | ||
run: git add shared/presentation/src/androidMain/res/values* | ||
|
||
- name: Add ios strings to Git | ||
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'all' }} | ||
run: git add iosApp/Localizable.xcstrings | ||
|
||
- 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" | ||
git commit -a -m "Github Action automatic translation of strings" | ||
- name: GitHub Push | ||
uses: ad-m/[email protected] | ||
|
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