Add note on how to add a new translation key (#2536)

* Add note on how to add a new translation key

* Lint

* Nit
This commit is contained in:
Hugh Nimmo-Smith
2024-08-07 10:40:44 +01:00
committed by GitHub
parent f928e63c7b
commit b13fa85465

View File

@@ -141,6 +141,28 @@ Run backend components:
yarn backend
```
### Add a new translation key
To add a new translation key you can do these steps:
1. Add the new key entry to the code where the new key is used: `t("some_new_key")`
1. Run `yarn i18n` to extract the new key and update the translation files. This will add a skeleton entry to the `public/locales/en-GB/app.json` file:
```jsonc
{
...
"some_new_key": "",
...
}
```
1. Update the skeleton entry in the `public/locales/en-GB/app.json` file with the English translation:
```jsonc
{
...
"some_new_key": "Some new key",
...
}
```
## Documentation
Usage and other technical details about the project can be found here: