Skip to content

Commit

Permalink
feat: sync i18n with crowdin (#8293)
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Sep 19, 2024
1 parent 6921c30 commit 9a01da7
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 657 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/languages-sync.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/sync-i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sync I18n with Crowdin

on:
push:
workflow_dispatch:

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: true
download_translations: true
auto_approve_imported: true
import_eq_suggestions: true
export_only_approved: true
skip_untranslated_strings: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
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: 'canary'
config: packages/frontend/i18n/crowdin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
12 changes: 12 additions & 0 deletions packages/frontend/i18n/crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'base_path': '.'
'base_url': 'https://api.crowdin.com'

'preserve_hierarchy': true

'files':
[
{
'source': '/src/resources/en.json',
'translation': '/src/resources/%locale%.json',
},
]
5 changes: 1 addition & 4 deletions packages/frontend/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
},
"scripts": {
"build": "node build.mjs",
"dev": "node dev.mjs",
"sync-languages": "node --loader ts-node/esm/transpile-only src/scripts/sync.ts",
"sync-languages:check": "yarn run sync-languages --check",
"download-resources": "node --loader ts-node/esm/transpile-only src/scripts/download.ts"
"dev": "node dev.mjs"
},
"keywords": [],
"repository": {
Expand Down
212 changes: 0 additions & 212 deletions packages/frontend/i18n/src/scripts/api.ts

This file was deleted.

Loading

0 comments on commit 9a01da7

Please sign in to comment.