-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: crowdin integration #415
base: main
Are you sure you want to change the base?
Changes from all commits
be6ecfb
728ed90
dda0189
aa9ea06
dfd729d
fd57b52
c58d871
b8ff19e
3738635
66a622f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Crowdin To GitHub | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '15 * * * *' # sync every hour | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Sync Crowdin to Github | ||
uses: crowdin/[email protected] | ||
with: | ||
upload_sources: false | ||
upload_translations: false | ||
download_translations: true | ||
localization_branch_name: i18n_crowdin | ||
create_pull_request: true | ||
push_sources: false | ||
pull_request_title: 'New Crowdin Translations' | ||
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' | ||
pull_request_base_branch_name: 'main' | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
GITHUB_TOKEN: ${{ github.token }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: GitHub To Crowdin | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Sync GH and Crowdin | ||
uses: crowdin/[email protected] | ||
with: | ||
upload_sources: true | ||
upload_translations: false | ||
download_translations: false | ||
create_pull_request: false | ||
localization_branch_name: i18n_crowdin | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
GITHUB_TOKEN: ${{ github.token }} |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,59 @@ | ||||||||||||||
# | ||||||||||||||
# Your Crowdin credentials | ||||||||||||||
# | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
"project_id_env": "CROWDIN_PROJECT_ID" | ||||||||||||||
"api_token_env": "CROWDIN_PERSONAL_TOKEN" | ||||||||||||||
"base_path": "." | ||||||||||||||
"base_url": "https://api.crowdin.com" | ||||||||||||||
|
||||||||||||||
# | ||||||||||||||
# Choose file structure in Crowdin | ||||||||||||||
# e.g. true or false | ||||||||||||||
# | ||||||||||||||
Comment on lines
+8
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
"preserve_hierarchy": true | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would false look like in crowdin? |
||||||||||||||
|
||||||||||||||
# | ||||||||||||||
# Files configuration | ||||||||||||||
# | ||||||||||||||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
files: [ | ||||||||||||||
{ | ||||||||||||||
"source": "**/*.i18n.en-us.js", | ||||||||||||||
"translation": "%original_path%/%file_name%.i18n.%locale%.js", | ||||||||||||||
"languages_mapping": { | ||||||||||||||
"locale": | ||||||||||||||
{ | ||||||||||||||
"cs": "cs-cz", | ||||||||||||||
"de": "de-de", | ||||||||||||||
"fr": "fr-fr", | ||||||||||||||
"hu": "hu-hu", | ||||||||||||||
"it": "it-it", | ||||||||||||||
"pt-BR": "pt-br", | ||||||||||||||
"ro": "ro-ro", | ||||||||||||||
"es-ES": "es-es", | ||||||||||||||
"th": "th-th" | ||||||||||||||
}, | ||||||||||||||
}, | ||||||||||||||
"translation_replace": { | ||||||||||||||
".i18n.en-us": "" | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
{ | ||||||||||||||
"source": "/src/i18n/translations/en-us/global.js", | ||||||||||||||
"translation": "/src/i18n/translations/%locale%/global.js", | ||||||||||||||
"languages_mapping": { | ||||||||||||||
"locale": | ||||||||||||||
{ | ||||||||||||||
"cs": "cs-cz", | ||||||||||||||
"de": "de-de", | ||||||||||||||
"fr": "fr-fr", | ||||||||||||||
"hu": "hu-hu", | ||||||||||||||
"it": "it-it", | ||||||||||||||
"pt-BR": "pt-br", | ||||||||||||||
"ro": "ro-ro", | ||||||||||||||
"es-ES": "es-es", | ||||||||||||||
"th": "th-th" | ||||||||||||||
}, | ||||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's enough to run this once a day, as the changes aren't released that fast anyway. Or would there be a reason to do this every hour?