DEV Community

Cover image for 🌍 How to Check 7,000 Translation Keys in 5 Seconds (Without Losing Your Mind)
Leo Korsunsky
Leo Korsunsky

Posted on

🌍 How to Check 7,000 Translation Keys in 5 Seconds (Without Losing Your Mind)

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 others

  • Copied 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
Enter fullscreen mode Exit fullscreen mode

Result:

Checking: src/i18n/es.json (Spanish)
Found: 2 untranslated values
  PASSWORD: "Password"           # ← English in Spanish file
  CANCEL: "Cancel"
Enter fullscreen mode Exit fullscreen mode
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
Enter fullscreen mode Exit fullscreen mode

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
}
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode
# 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
Enter fullscreen mode Exit fullscreen mode
CI/CD Integration
{
  "scripts": {
    "i18n:check": "i18n-quality-lint",
    "test": "npm run i18n:check && jest"
  }
}
Enter fullscreen mode Exit fullscreen mode

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)