Manage and view the i18n files of any project: inline translations, missing-key diagnostics, key rename, hard-string extraction, and the x18n UI in a panel.
This extension is in early development. See the plan.
Features
All i18n logic lives in the bundled x18n language server; the extension only presents it.
In-place annotations (on by default): keys in code show their display-locale value. The cursor line and selections show the raw key, and missing keys show in a warning color. With in-place off, values show as hints after the key.
Keys as symbols: go to definition, implementation, references and rename work across code and every locale file, next to TypeScript's own results.
Hover with every locale's value, completion of keys, diagnostics equal to x18n check, and quick fixes to add, fill or extract.
Activity bar views: Current File, Progress, Keys and Usage Report.
Status bar: the display locale; click to switch.
x18n UI in a panel, also opened at a single key from hovers and views.
Copy a translate prompt for an agent or LLM, from the palette, a hover or a key.
Schema validation for x18n.config.json, x18n.config.y(a)ml and *.x18n-plugin.y(a)ml (YAML needs the Red Hat YAML extension).
Migration from i18n-ally: when .vscode/settings.json has i18n-ally.* settings and there is no x18n config, the extension offers to generate one and shows it before writing.
Project settings live in x18n.config.ts; the settings below only change the editor experience.
Commands
Command
Title
x18n.openUi
x18n: Open UI
x18n.openKey
x18n: Open Key in UI
x18n.setDisplayLocale
x18n: Set Display Locale
x18n.editKey
x18n: Edit Message
x18n.renameKeyPrefix
x18n: Rename Key Prefix
x18n.deleteKey
x18n: Delete Key
x18n.extract
x18n: Extract Hard String
x18n.extractFile
x18n: Extract All Hard Strings in File
x18n.copyTranslatePrompt
x18n: Copy Translate Prompt
x18n.goToNextUsage
x18n: Go to Next Key Usage
x18n.goToPrevUsage
x18n: Go to Previous Key Usage
x18n.toggleInPlace
x18n: Toggle In-place Annotations
x18n.restartServer
x18n: Restart Language Server
x18n.migrateFromI18nAlly
x18n: Migrate from i18n-ally
x18n.showOutput
x18n: Show Output
Configurations
Key
Description
Type
Default
x18n.enabled
Run the x18n language server in this workspace.
boolean
true
x18n.useLocalServer
Run the @x18n/lsp installed in the workspace's node_modules instead of the bundled server, when there is one. Restart the server after changing this.
boolean
true
x18n.annotations
Show translated values next to or in place of keys in code.
boolean
true
x18n.inPlace
Replace keys in code with their display-locale value. The raw key shows on the cursor line and inside selections.
boolean
true
x18n.annotationMaxLength
Longest value shown in an annotation. Longer values are truncated, and in-place mode falls back to an after-key hint.
number
40
x18n.displayLocale
Locale shown in annotations. Empty means the source locale.
string
""
x18n.codeLens
Show usage counts and missing locales above keys in resource files.
boolean
false
x18n.trace.server
Trace the communication between VS Code and the x18n language server.