Skip to content

chore: set up i18n automation #1

chore: set up i18n automation

chore: set up i18n automation #1

Workflow file for this run

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: Parse translations
run: npx -p i18next-parser i18next -c i18next-parser.config.cjs -o "${{ runner.temp }}/i18next/\$LOCALE/\$NAMESPACE.json" "./src/**/*.{js,jsx,ts,tsx}"
- 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