A Problem Every Developer Knows
Imagine: you launch your app in Spanish, and suddenly, in the middle of a perfectly translated interface, you see a βSubmitβ button. Or worse, an entire screen in English because someone forgot to add a key to en.json
Sound familiar? It does to me.
The Problem I Was Solving
Our project has 8 languages and ~7,000 translation keys. Typical problems:
Added a new feature β forgot to translate it into all supported languages
Renamed a key in
en.jsonβ didnβt update it in the othersCopied English text as a placeholder β forgot to replace it
Manual checking before each release became a routine. We needed an automatic linter, like ESLint, but for translations.
Solution: i18n-quality-lint
I created a CLI tool that checks all translations in seconds:
npm install --save-dev i18n-quality-lint
npx i18n-quality-lint
Result:
Checking: src/i18n/es.json (Spanish)
Found: 2 untranslated values
PASSWORD: "Password" # β English in Spanish file
CANCEL: "Cancel"
Checking: src/i18n/fr.json (French)
Found: 1 untranslated values
WELCOME: "Welcome"
π Checking key synchronization...
Found: 2 synchronization issues
src/i18n/es.json:
Missing keys (1):
SUBMIT_BUTTON # β Key exists in EN but not in ES
What the Tool Does
1οΈβ£ Finds Untranslated Strings
Supports 60+ languages β from Chinese to Klingon
2οΈβ£ Synchronizes Keys
Shows which keys are missing or extra in different files
3οΈβ£ Checks Key Order
Optionally verifies that keys are in the same order across all files
4οΈβ£ Flexible Configuration
{
"files": [
{
"path": "src/i18n/en.json",
"language": "english",
"allowlist": ["API", "OAuth", "GitHub"],
"ignoreKeys": ["DEBUG_MODE"]
}
],
"checkKeyOrder": true,
"failOnFindings": true
}
Real-World Use Cases
π’ E-commerce Platform
10 languages, 500+ translation keys. The tool found 47 untranslated strings in 3 seconds.
π SaaS Application
CI/CD integration β now PRs donβt pass if there are translation issues.
π₯ Open Source Project
Automatic validation of translations from contributors.
Why It Matters
β Without Automation:
- Hours spent manually searching through thousands of keys
- Missed bugs in production
- Unhappy users
β With i18n-quality-lint:
- 5 seconds to check
- Automatic detection in CI/CD
- Quality localization
Quick Start
# Install
npm install --save-dev i18n-quality-lint
# Create config
echo '{
"files": [
{"path": "src/i18n/en.json", "language": "english"},
{"path": "src/i18n/es.json", "language": "spanish"}
]
}' > .i18ncheckrc.json
# Run check
npx i18n-quality-lint
CI/CD Integration
{
"scripts": {
"i18n:check": "i18n-quality-lint",
"test": "npm run i18n:check && jest"
}
}
Technical Details
Zero dependencies β pure Node.js
Fast β O(1) lookup via Set
Lightweight β 10kB package size
Whatβs Next?
Try it yourself:
π¦ npm package
β GitHub
π Documentation
Conclusion
Localization isnβt just about translating text. Itβs about product quality and respect for users. Automating translation checks saves time and prevents bugs.
It takes 2 minutes to set up, but it saves hours.
Top comments (0)