Skip to content
i18n Doctor

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.

Health score

82/ 100

50708090
Grade
A
CI threshold
70 · B
Result
Passed
better-i18n doctorOne command, five analysis layers, one score your CI can gate on.
01Analysis

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.

  1. 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.
  2. 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.
  3. 03Quality — Placeholder MismatchVerifies interpolation placeholders are consistent across all locales. Supports named {}, double-brace {{}}, printf %s, template ${}, and positional {0} formats.
  4. 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.
  5. 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.
02Scoring

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

GradeScoreCI
GradeA+
Score≥ 90
CIPass
GradeA
Score≥ 80
CIPass
GradeB
Score≥ 70
CIPass
GradeC
Score≥ 50
CIFail
GradeF
Score< 50
CIFail
03Continuous integration

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.

  1. 01GitHub Actions with OIDCAuthenticate automatically without API keys using GitHub Actions OIDC. Just add id-token: write permission and run doctor --ci --report.
  2. 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.
  3. 03Machine-Readable JSONUse --format json for structured output you can pipe into jq, custom dashboards, or downstream automation in your deployment pipeline.
  4. 04Dashboard ReportingUpload results to the Lefine dashboard with --report for historical tracking, trend analysis, and team-wide visibility into i18n health.
.github/workflows/i18n.yml
# GitHub Actions example- run: npx @better-i18n/cli doctor --ci --report
04Commands

When 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.
05Capabilities

Built for Real-World i18n Workflows

  1. 01Health Score 0–100Single score with per-category breakdown and CI pass/fail threshold. Track your translation health over time.
  2. 02Lexical Scope TrackingSmart namespace detection for both useTranslations and getTranslations. Every t() call maps to its correct namespace.
  3. 03Server Component SupportFull support for Next.js App Router async server functions. Server-side getTranslations calls are detected and audited.
  4. 04Configurable RulesDisable or downgrade rules in i18n.config.ts. Set rules to "error", "warning", or "off" to match your project's needs.
  5. 05Smart FilteringAutomatically ignores CSS class names, URLs, import paths, and developer constants. Only actionable results.
  6. 06Verbose Audit LogDeep transparency with --verbose. Scoping summaries, timing information, and namespace resolution traces for debugging.
Get started

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.