Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Update README about translation usage #4279

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,30 +177,19 @@ But sometimes the UI changes and new English descriptions are added or existing
ones have been rephrased. In this case the new keys must be extracted from the
source code and added to the JSON files. This can be done by running

```
```sh
npm run i18n-extract
```

New translation strings are added with an empty string `“”` as default value.
Therefore searching for empty strings will find the to be translated values.
Keys with a `_plural` suffix can be ignored. They are just added for technical
reasons and are unused.

If not all strings are translated at once the remaining empty strings would
cause missing text in web UI. Therefore, the JSON files must be cleaned up
before adding the changes to git and creating a pull request. To clean up the
JSON files the following command can be used

```
npm run clean-up-translations
```

### Support a new Language

The currently supported languages are listed at [src/gmp/locale/languages.js](./src/gmp/locale/languages.js#L23).
If a new language should be available in the web UI, it needs an entry in this
object. Additionally the corresponding language codes must be added to the
[babel config](./.babelrc) and [cleanup script](./scripts/cleanuptranslations.js).
[i18next-parser.config.js](./i18next-parser.config.js).

## Settings

Expand Down
Loading