Skip to content

Commit

Permalink
chore(i18n): Add a script to translate messages using Deep (#528)
Browse files Browse the repository at this point in the history
* chore(i18n): Add a script to translate using Deepl

You can call it using `npm run i18n:translate <lang>`

* chore(i18n): Update fr messages

* chore: add info in readme
  • Loading branch information
qgerome authored Jan 11, 2024
1 parent 696821e commit 448ea5b
Show file tree
Hide file tree
Showing 5 changed files with 639 additions and 404 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ npm run lint && npm run format
* `npm run schema`: Run an introspection query on the graphql backend and generate a `schema.graphql` file. This file is used to generate typescript types & for DX in the IDE
* `npm run codegen`: Generate typescript types found in all the files based on `schema.graphql`
* `npm run i18n:extract`: Extract translatable strings and write `messages.json` files for each language
* `npm run i18n:translate` Translate the `messages.json` files using DeepL (requires a DeepL API key `DEEPL_API_KEY` to be set).


## Internationalization
Expand All @@ -143,6 +144,19 @@ npm run i18n:extract

Translations are stored in `public/locales/[lang]/[ns].json`.

To translate the strings using DeepL, run the translate command:

```bash
npm run i18n:translate fr # translate to French
```
or
```bash
npm run i18n:translate fr --overwrite # translate to French and overwrite all the strings
```




## Versioning

This library follows [Semantic Versioning](http://semver.org/).
Expand Down
Loading

0 comments on commit 448ea5b

Please sign in to comment.