Skip to content

Commit

Permalink
Integrate simple localize (#834)
Browse files Browse the repository at this point in the history
* feat: wrap language settings access behind feature flag

* chore: configure simple localize rather than locize

* test: update github ci for simple localize

* fix: i18nconfig options

* fix: use upload instead of extract for simplelocalize github action

* test: attempt to extract and upload translation files separately

* fix: typo!

* fix: simplelocalize config file

* feat: add webpack plugin for downloading simple localize translations

* fix: catch bad response from simple localize api in webpack plugin

* feat: improve simple localize download

* feat: automaticaly populate available languages from simple localize

* fix: github secrets -> env vars

* fix: add Simple localize env vars to types for process.env

* chore: delete unwanted locale files for english
  • Loading branch information
chidg authored Jul 10, 2023
1 parent accd198 commit 6a30810
Show file tree
Hide file tree
Showing 17 changed files with 191 additions and 924 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ jobs:
echo "sha_short=$sha_short" >> $GITHUB_OUTPUT
npm_package_version=$(cat apps/extension/package.json | jq -r .version)
echo "npm_package_version=$npm_package_version" >> $GITHUB_OUTPUT
- name: Extract translatable strings
run: yarn run update:translations
- name: Upload translatable strings
uses: simplelocalize/github-action-cli@v1
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'upload'
cli-version: '2.2.0'
args: '--apiKey ${{ secrets.SIMPLELOCALIZE_API_KEY }}'
- name: Build
run: yarn run build:extension:ci
env:
Expand All @@ -57,6 +66,8 @@ jobs:
EXTENSION_PREFIX: talisman
API_KEY_ONFINALITY: ${{ secrets.API_KEY_ONFINALITY }}
POSTHOG_AUTH_TOKEN: ${{ secrets.POSTHOG_AUTH_TOKEN }}
SIMPLE_LOCALIZE_API_KEY: ${{ secrets.SIMPLE_LOCALIZE_API_KEY }}
SIMPLE_LOCALIZE_PROJECT_TOKEN: ${{ secrets.SIMPLE_LOCALIZE_PROJECT_TOKEN }}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Upload build artifacts
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ yarn-error.log*

# extension
dist
apps/extension/public/locales/*
6 changes: 1 addition & 5 deletions apps/extension/i18next-parser.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

// The key is the `locale` as passed to i18next.
// The value is the `human-readable name` as passed to the language settings UI in the wallet.
// TODO all other languages disabled for now, until we have translations
const languages = {
const languages = process.env.SUPPORTED_LANGUAGES || {
en: "English",
// cn: "中文",
// ru: "Pусский",
// fr: "Français",
}

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"jest": "27.5.1",
"jest-fetch-mock": "^3.0.3",
"jest-webextension-mock": "3.8.9",
"node-fetch": "^3.3.1",
"postcss": "^8.4.20",
"postcss-import": "^15.1.0",
"postcss-loader": "^7.0.2",
Expand Down
263 changes: 0 additions & 263 deletions apps/extension/public/locales/en/admin.json

This file was deleted.

283 changes: 0 additions & 283 deletions apps/extension/public/locales/en/common.json

This file was deleted.

47 changes: 0 additions & 47 deletions apps/extension/public/locales/en/onboard.json

This file was deleted.

Loading

0 comments on commit 6a30810

Please sign in to comment.