diff --git a/libs/datasource/i18n/README.md b/libs/datasource/i18n/README.md index ff902b333c..c454be380a 100644 --- a/libs/datasource/i18n/README.md +++ b/libs/datasource/i18n/README.md @@ -8,7 +8,7 @@ import { useTranslation } from '@toeverything/datasource/i18n'; // base.json // { // 'Text': 'some text', -// 'Switch to language': 'Switch to {language}', +// 'Switch to language': 'Switch to {{language}}', // <- you can interpolation by curly brackets // }; const App = () => { @@ -41,10 +41,12 @@ const App = () => { export TOLGEE_API_KEY=tgpak_XXXXXXX ``` -- Run the `sync` script from package script +- Run the `sync-languages:check` to check all languages +- Run the `sync-languages` script to add new keys to the tolgee platform ## References +- [AFFiNE | Tolgee](https://i18n.affine.pro/) +- [Tolgee Documentation](https://tolgee.io/docs/) - [i18next](https://www.i18next.com/) - [react-i18next](https://react.i18next.com/) -- [Tolgee](https://tolgee.io/docs/) diff --git a/libs/datasource/i18n/package.json b/libs/datasource/i18n/package.json index 8f6afe9b85..cabc0a36b6 100644 --- a/libs/datasource/i18n/package.json +++ b/libs/datasource/i18n/package.json @@ -2,7 +2,8 @@ "name": "@toeverything/datasource/i18n", "version": "0.0.1", "scripts": { - "sync": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/sync.ts" + "sync-languages": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/sync.ts", + "sync-languages:check": "pnpm run sync-languages --check" }, "dependencies": { "i18next": "^21.9.1",