diff --git a/README.md b/README.md index dc5d496..233dcd0 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,58 @@ class ClassName { } ``` +## No Missing Translations + +This ESLint rule ensures that every call to `i18n.t(...)` in the codebase has a corresponding key in all translation files. A translation file is defined as an input file for the npm package `i18n-js` (https://www.npmjs.com/package/i18n-js). + +## Examples + +Translation file (`nl.json`): +``` +{ + 'Hello world!': "Hallo wereld!" +} +``` + +
❌ Incorrect | ✅ Correct | +
+ +```typescript +i18n.t('Missing translation key') +``` + | ++ +```typescript +i18n.t('Hello world') +``` + | +