chore(i18n): update package

This commit is contained in:
lawvs 2022-09-09 14:33:58 +08:00
parent 54f1db6fdc
commit 1018149ca4
2 changed files with 7 additions and 4 deletions

View File

@ -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/)

View File

@ -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",