i18n-radar
v1.0.3
Published
CLI tool for auditing i18n translations
Downloads
313
Readme
i18n-radar 📡
The type-safe, format-agnostic i18n audit tool for Enterprise teams.
The Problem
In large apps, translations are split across 100s of files. Manual checks fail, leading to broken UIs and missing params in production.
The Solution
i18n-radar validates your entire file system at build time using strict static analysis.
Key Features
- 🌲 Deep Tree Analysis: Supports complex, nested folder structures with Glob patterns (e.g.,
locales/{lang}/**/*.ts). - 🏗 Format Agnostic: Works natively with TypeScript, JavaScript, and JSON (powered by
jiti). - 🔍 Smart Diff: Doesn't just say "Error". Tells you: "Missing variable {name}, found {isim}".
- ⚡ Developer Experience: Clean, collapsible "Tree View" terminal output.
Installation
npm install -D i18n-radarConfiguration
Create i18n-radar.config.ts in your project root:
Scenario A: Simple Structure
For projects with one file per language:
export default {
baseLanguage: "en",
targetLanguages: ["tr", "de"],
pathPattern: "locales/{lang}.json",
};Scenario B: Enterprise Split-File Structure
For large projects with nested directories and multiple files per language:
export default {
baseLanguage: "en",
targetLanguages: ["tr", "de", "fr"],
// This Glob pattern matches any nested structure!
// Automatically maps en/auth.ts → tr/auth.ts, en/dashboard.ts → tr/dashboard.ts, etc.
pathPattern: "./src/locales/{lang}/**/*.ts",
};Scenario C: Feature-Based / Colocation
For projects where translations live next to components (not in a central folder):
/src
/features
/auth
login.tsx
en.ts <-- Located inside feature
tr.ts
/dashboard
en.ts
tr.tsexport default {
baseLanguage: "en",
targetLanguages: ["tr"],
// Matches {lang}.ts files in any nested feature directory
pathPattern: "./src/features/**/{lang}.ts",
};Usage
# Summary view (first 5 issues)
npx i18n-radar check
# Full output with all errors
npx i18n-radar check --verboseCI/CD Integration
Block PRs if translations are missing. Add to .github/workflows/pr-check.yml:
name: i18n Audit
on: [pull_request]
jobs:
i18n-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- run: npm install
- run: npx i18n-radar check
# Fails the CI if any translation issues are foundComparison
| Feature | i18n-radar | Standard Linters | | ------------------------------------ | ---------- | ---------------- | | Missing Keys Detection | ✅ | ❌ | | TypeScript Support | ✅ | ❌ | | Parameter Validation ({name} checks) | ✅ | ❌ |
Built for Enterprise Teams: Type-safe, scalable, and CI-ready.
