-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kohei Asai
committed
Feb 18, 2024
1 parent
8b3314d
commit a4c4f3f
Showing
4 changed files
with
74 additions
and
7 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
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: I18n Dictionary Download | ||
on: | ||
repository_dispatch: | ||
types: | ||
- simplelocalize_publication | ||
jobs: | ||
download-and-apply: | ||
name: Dictionary Download | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install SimpleLocalize CLI | ||
run: curl -s https://get.simplelocalize.io/2.5/install | bash | ||
- name: Download the dictionary files from artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: i18n-dictionaries | ||
path: ${{ runner.temp }}/i18next | ||
- name: Upload the dictionary files to SimpleLocalize | ||
run: | | ||
simplelocalize download \ | ||
--apiKey ${{ secrets.SIMPLELOCALIZE_API_KEY }} \ | ||
--downloadFormat=single-language-json \ | ||
--downloadPath=./src/locales/{lang}/{ns}.json | ||
- name: Upload the parsed dictionary files as artifacts | ||
run: | | ||
git switch -c i18n-update-${{ github.run_id }} | ||
git add . | ||
git commit -m "feat(i18n): apply i18n dictionary update(s)" | ||
git push origin i18n-update-${{ github.run_id }} | ||
- name: Create a pull request | ||
run: | | ||
gh pr create \ | ||
--base main \ | ||
--head i18n-update-${{ github.run_id }} \ | ||
--assignee @me \ | ||
--title "feat(i18n): apply i18n dictionary update(s)" | ||
--reviewer @axross |
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,31 @@ | ||
name: I18n Dictionary Upload | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- i18n-automation-setup | ||
jobs: | ||
parse-and-upload: | ||
name: Dictionary Upload | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
- name: Install i18next-parser | ||
run: npm i -g i18next-parser@8 | ||
- name: Parse translations | ||
run: npx -p i18next-parser i18next -c i18next-parser.config.cjs -o "${{ runner.temp }}/i18next/\$LOCALE/\$NAMESPACE.json" | ||
- name: Install SimpleLocalize CLI | ||
run: curl -s https://get.simplelocalize.io/2.5/install | bash | ||
- name: Upload the dictionary files to SimpleLocalize | ||
run: | | ||
simplelocalize upload \ | ||
--apiKey ${{ secrets.SIMPLELOCALIZE_API_KEY }} \ | ||
--languageKey=en-US \ | ||
--uploadFormat=single-language-json \ | ||
--uploadOptions=DELETE_NOT_PRESENT_KEYS,TRIM_LEADING_TRAILING_SPACES \ | ||
--uploadPath=${{ runner.temp }}/i18next/{lang}/{ns}.json |
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