VS Code extension to audit i18n usage.
What it checks
- String literals in code that look user-facing and are not wrapped in translation functions.
- Translation keys used in code (e.g.
t('home.title')) that are missing from translation JSON files. - Translation keys that exist but have empty values (
"",null, orundefined) in language files.
Markdown Report
After each scan, the extension writes translation-report.md in the workspace root.
The report includes:
- Pages/files grouped by path.
- Exact line number for each used key.
- Missing languages for each key.
- Languages where the key exists but has an empty value.
Project Config File
On first activation, the extension creates a project config file at .translation-doctor.json in the workspace root.
This file contains all required scan settings:
languagestranslationFilePatternsourceIncludeGlobsourceExcludeGlobtranslationFunctionsminLiteralLength
Translation Doctor: Configure updates this file directly.
Commands
Translation Doctor: ConfigureTranslation Doctor: Scan Workspace
Configuration
translationDoctor.languagestranslationDoctor.translationRootDir(e.g.i18n, scansi18n/{lang}/**/*.json)translationDoctor.translationFilePattern(supports{lang}placeholder)translationDoctor.sourceIncludeGlobtranslationDoctor.sourceExcludeGlobtranslationDoctor.translationFunctionstranslationDoctor.minLiteralLength
If translationDoctor.translationRootDir is set, it takes priority over translationDoctor.translationFilePattern.
Supported Translation Structures
- Single file per language:
{
"translationFilePattern": "i18n/{lang}.json",
"languages": ["en", "ar"]
}
- Folder per language (many files):
{
"translationFilePattern": "i18n/{lang}/**/*.{json,ts,js}",
"languages": ["en", "ar"]
}
i18n/index.tsthat imports language trees (./en,./ar, etc.):
{
"translationFilePattern": "i18n/index.ts",
"languages": ["en", "ar"]
}
The scanner now supports both JSON and TypeScript/JavaScript translation sources.