forked from ajnart/homarr
-
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.
feat: integrate crowdin ajnart#1402 (ajnart#1599)
- Loading branch information
1 parent
bf45860
commit 096f034
Showing
3 changed files
with
76 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "[Crowdin] Download translations" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" # every day at midnight | ||
|
||
jobs: | ||
download-crowdin-translations: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Obtain token | ||
id: obtainToken | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
private_key: ${{ secrets.CROWDIN_APP_PRIVATE_KEY }} | ||
app_id: ${{ secrets.CROWDIN_APP_ID }} | ||
|
||
- name: Download Crowdin translations | ||
uses: crowdin/github-action@v2 | ||
with: | ||
upload_sources: false | ||
upload_translations: false | ||
download_translations: true | ||
localization_branch_name: crowdin | ||
create_pull_request: true | ||
pull_request_title: "chore(lang): updated translations from crowdin" | ||
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)" | ||
pull_request_base_branch_name: "dev" | ||
github_user_name: "Crowdin Homarr" | ||
github_user_email: "190541745+homarr-crowdin[bot]@users.noreply.github.com" | ||
env: | ||
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "[Crowdin] Upload translations" | ||
|
||
on: | ||
push: | ||
paths: | ||
- "packages/translation/src/lang/**" | ||
branches: [dev] | ||
|
||
jobs: | ||
upload-crowdin-translations: | ||
# Don't run this action if the downloaded translations are being pushed | ||
if: "!contains(github.event.head_commit.message, 'chore(lang)')" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Upload Crowdin translations | ||
uses: crowdin/github-action@v2 | ||
with: | ||
upload_sources: true | ||
upload_translations: true | ||
download_translations: false | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
files: | ||
- source: /packages/translation/src/lang/en.json | ||
translation: /packages/translation/src/lang/%two_letters_code%.json | ||
|
||
# Title of pull request and so the commit that will be used for squashed merge commit | ||
pull_request_title: "chore(lang): updated translations from crowdin" | ||
|
||
# Custom commit message that is not only appended | ||
commit_message: "chore(lang): update translations %original_file_name% from crowdin [skip ci]" | ||
append_commit_message: false |