i18n Doctor: Get a Full Translation Health Report in One Command
Run better-i18n doctor to analyze your entire codebase across five dimensions — code quality, translation coverage, placeholder accuracy, orphan keys, and CDN sync — and get a single 0–100 health score with actionable diagnostics.
82/ 100
- Grade
- A
- CI threshold
- 70 · B
- Result
- Passed
Five Analysis Layers in a Single Pass
Doctor runs code scanning, coverage analysis, quality verification, performance auditing, and CDN sync checks — all at once, with a unified score.
- 01Code — Hardcoded String DetectionAST-based scanning finds every user-facing string not wrapped in t(). Catches JSX text, attributes, ternary locale logic, toast messages, and string variables.
- 02Coverage — Missing TranslationsCompares keys present in your source locale against each target locale. Any key missing from a target locale is reported with its exact namespace and path.
- 03Quality — Placeholder MismatchVerifies interpolation placeholders are consistent across all locales. Supports named {}, double-brace {{}}, printf %s, template ${}, and positional {0} formats.
- 04Performance — Orphan Key DetectionDetects keys that exist in your translation files but are never referenced in code. Orphan keys increase payload size and create maintenance debt.
- 05Sync — CDN ComparisonCompares keys extracted from your code against published keys in the CDN. Surfaces missing-in-remote and unused-remote-key issues before they hit production.
A Single Score for Your Translation Health
Doctor computes a score from 0 to 100 based on the diagnostics found. Errors are penalized at 3.0 points each, while each rule's warning contribution is capped at 20 points — preventing a single rule with thousands of warnings from zeroing your entire score.
The default pass threshold is 70 (grade B). Use --ci to fail builds below this threshold, or start with --report to establish a baseline before enforcing the score.
Grade Thresholds
CI/CD Integration — Block Bad Translations Before They Ship
Add doctor to your CI pipeline to catch translation regressions on every push. Automatic OIDC auth in GitHub Actions means zero secret management.
- 01GitHub Actions with OIDCAuthenticate automatically without API keys using GitHub Actions OIDC. Just add id-token: write permission and run doctor --ci --report.
- 02Threshold GatingSet a pass threshold (default: 70) and fail the build when the score drops below it. Start tracking with --report, then enforce with --ci.
- 03Machine-Readable JSONUse --format json for structured output you can pipe into jq, custom dashboards, or downstream automation in your deployment pipeline.
- 04Dashboard ReportingUpload results to the Lefine dashboard with --report for historical tracking, trend analysis, and team-wide visibility into i18n health.
# GitHub Actions example- run: npx @better-i18n/cli doctor --ci --reportWhen to Use Which Command
Doctor is the comprehensive option. Use focused commands when you need a specific check or want faster feedback in pre-commit hooks.
doctor- Full health score with five analysis layers — the single source of truth for your project's i18n status.
scan- Focused hardcoded string detection. Supports --staged for pre-commit hooks.
check- Interactive checker for missing or unused translation keys with guided prompts.
sync- Full local-to-remote comparison showing both missing and unused keys at once.
Built for Real-World i18n Workflows
- 01Health Score 0–100Single score with per-category breakdown and CI pass/fail threshold. Track your translation health over time.
- 02Lexical Scope TrackingSmart namespace detection for both useTranslations and getTranslations. Every t() call maps to its correct namespace.
- 03Server Component SupportFull support for Next.js App Router async server functions. Server-side getTranslations calls are detected and audited.
- 04Configurable RulesDisable or downgrade rules in i18n.config.ts. Set rules to "error", "warning", or "off" to match your project's needs.
- 05Smart FilteringAutomatically ignores CSS class names, URLs, import paths, and developer constants. Only actionable results.
- 06Verbose Audit LogDeep transparency with --verbose. Scoping summaries, timing information, and namespace resolution traces for debugging.
Explore More
- CLI & Code ScanningAST-based hardcoded string detection and code scanning toolsOpen page
- For DevelopersDeveloper-focused i18n tools with type-safe SDKs and Git-first workflowsOpen page
- Localization SoftwareCompare localization platforms and what each one automates.Open page
- Translation ManagementCentralized platform for managing translation workflows at scaleOpen page
Start free.
Know Your Translation Health Before You Ship
Run better-i18n doctor once to get your baseline. Add it to CI to never ship missing translations again.