From a56ec340cfc3395e00274e7a2a1925654a3e71c0 Mon Sep 17 00:00:00 2001 From: Himavarshit18 Date: Tue, 11 Aug 2026 22:14:45 +0530 Subject: [PATCH] docs: expand i18n README with usage examples Replaces placeholder text in frontend/src/i18n/README.md with actual i18n development documentation. Also removes the circular reference by deleting frontend/docs/development/i18n.md (which was just a TODO). Changes: - Adds code examples for useTranslation hook - Documents the npm run i18n command - Lists translation file namespaces - Removes docs/development/i18n.md TODO file This helps frontend contributors understand Nebraska's internationalization workflow by providing documentation next to the i18n code. Signed-off-by: Himavarshit18 --- frontend/docs/development/i18n.md | 1 - frontend/src/i18n/README.md | 21 +++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) delete mode 100644 frontend/docs/development/i18n.md diff --git a/frontend/docs/development/i18n.md b/frontend/docs/development/i18n.md deleted file mode 100644 index 0e637394b..000000000 --- a/frontend/docs/development/i18n.md +++ /dev/null @@ -1 +0,0 @@ -TODO: Add i18n development docs diff --git a/frontend/src/i18n/README.md b/frontend/src/i18n/README.md index 3d23d51ac..7ad7968df 100644 --- a/frontend/src/i18n/README.md +++ b/frontend/src/i18n/README.md @@ -1,5 +1,22 @@ # i18n Internationalization / Localization -We try and keep all the i18n related things in here. +Nebraska frontend uses [i18next](https://www.i18next.com/) for internationalization. Translation files are organized by namespace in `locales/en/` (`common.json`, `applications.json`, `groups.json`, etc.). -See the [i18n docs](../../docs/development/i18n.md) for full details. +## Using Translations + +```typescript +import { useTranslation } from 'react-i18next'; + +function MyComponent() { + const { t } = useTranslation(); + return
{t('common|confirmation_prompt')}
; +} +``` + +## Extracting Translation Keys + +```bash +npm run i18n +``` + +This scans source files and updates translation JSON files.