Transloco Helper
A VSCode extension for Transloco I18N in Angular applications.

Features
- Cmd+click / Ctrl+click on a key — jumps directly to the entry for the configured default language.
- Clickable translation preview — a code lens above each key usage shows the translated string for your preferred language. Clicking it opens a quick pick of all known languages (every
.json file in the asset folder, plus the configured default language) and jumps to the matching entry. If the entry (or the whole language file) does not exist yet, it is created on the spot — with the value copied from the default language.
- Missing entries hint — when a language file is opened, an information message suggests creating the entries missing compared to the default language file (also available as a code lens at the top of the file and via the
Transloco Helper: Create Missing Entries command). Entries are created with the default language's values.
- Obsolete entries hint - when a language file is opened, an information message suggests removing entries not referenced in the code. This can also be invoked via the
Transloco Helper: Remove Unused Entries command.
Supported usage patterns
Templates (.html, .angular):
<!-- translate pipe -->
{{ 'greeting' | translate }}
<!-- *transloco structural directive (prefix applied) -->
<ng-container *transloco="let t; prefix: 'feat-1'">
{{ t("messages.loading") }}
</ng-container>
Inline templates (.ts, .js)
@Component({
imports: [
TranslocoModule
],
template: `<ng-container *transloco="let t; prefix: 'feat-1'">
{{ t("messages.loading") }}
</ng-container>`
})
TypeScript (.ts) and JavaScript (.js, .mjs, .cjs):
import { translate, TranslocoModule } from "@jsverse/transloco";
translate('some.key');
Configuration
| Setting |
Default |
Description |
translocoHelper.assetPath |
src/assets/i18n |
Folder (relative to the workspace root) containing one JSON file per language. The filename without extension is the language code. |
translocoHelper.defaultLanguage |
en |
Default language used for the inline preview and the default jump target. |
Translation JSON files use nested keys (dot-notation):
{
"feat-1": {
"messages": {
"loading": "Loading..."
}
}
}
Commands
Cmd+click (or Ctrl+click on Windows/Linux) on a key usage jumps straight to the entry in the default language file — no language picker. If the entry is missing, no navigation happens (the file is not modified).
Transloco Helper: Create Missing Entries — in the language file currently open, create the entries that are missing compared to the default language file (values are copied from the default language).
Transloco Helper: Remove Unused Entries — remove entries that are not used anywhere. The default language file has entries removed when they are never referenced in the workspace; every other language file has entries removed when they are missing from the default language file. A preview and confirmation are shown before any file is rewritten.
Installation
Build the extension and install the generated .vsix:
npm install
npm run package
code --install-extension transloco-helper-0.3.0.vsix
Tests
Run unit tests with npm test and VS Code integration tests with npm run test:integration.
The integration runner downloads VS Code if a compatible version is not already cached.
References