Skip to content

Commit

Permalink
Change: Update README about translation usage
Browse files Browse the repository at this point in the history
With using i18next-parser we got rid of the plural terms. Also the
cleanup translations tooling was removed before already.
  • Loading branch information
bjoernricks committed Jan 9, 2025
1 parent 9be6cfc commit b80ab98
Showing 1 changed file with 2 additions and 13 deletions.
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

0 comments on commit b80ab98

Please sign in to comment.