From b13fa8546541829a51f1d5f046d2129578cf8fd0 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Wed, 7 Aug 2024 10:40:44 +0100 Subject: [PATCH] Add note on how to add a new translation key (#2536) * Add note on how to add a new translation key * Lint * Nit --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index ff3cb935..f487beed 100644 --- a/README.md +++ b/README.md @@ -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: