Feat: Localization

This commit is contained in:
wingio 2023-03-30 14:59:44 -04:00
parent 096e657558
commit 398f53a510
4 changed files with 52 additions and 3 deletions

42
.github/workflows/crowdin.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Sync Crowdin
on:
push:
branches:
- 'main'
paths:
- 'app/src/main/res/values/strings.xml'
- '.github/workflows/crowdin.yml'
schedule:
- cron: "0 17 * * 6" # "At 17:00 on Saturday."
workflow_dispatch:
jobs:
sync-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Crowdin
uses: crowdin/github-action@1.4.11
with:
config: crowdin.yml
upload_translations: true
download_translations: true
push_translations: true
create_pull_request: false
localization_branch_name: l10n
commit_message: 'chore(i18n): sync translations'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: Merge
run: |
sudo chmod -R ugo+rwX .
git checkout main
git add *
git merge l10n
git push

View File

@ -14,8 +14,8 @@ android {
applicationId = "dev.beefers.vendetta.manager"
minSdk = 24
targetSdk = 33
versionCode = 1061
versionName = "1.0.61"
versionCode = 1070
versionName = "1.0.7"
buildConfigField("String", "GIT_BRANCH", "\"${getCurrentBranch()}\"")
buildConfigField("String", "GIT_COMMIT", "\"${getLatestCommit()}\"")

View File

@ -221,7 +221,7 @@ class AboutScreen : Screen {
ElevatedCard {
ListItem(
text = stringResource(R.string.label_translate),
subtext = stringResource(R.string.msg_coming_soon)
onClick = { uriHandler.openUri("https://crowdin.com/project/vendetta-manager") }
)
}
}

7
crowdin.yml Normal file
View File

@ -0,0 +1,7 @@
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: true
files:
- source: app/src/main/res/values/strings.xml
translation: app/src/main/res/values-%android_code%/strings.xml