i18nsmith VS Code ExtensionTL;DR: Lightweight VS Code integration for i18nsmith — run health checks, sync locales, extract strings, and transform files from inside the editor. VS Code integration for i18nsmith — automated i18n tooling. Install the VSIX (see "How to test") or use the Marketplace once published. Features
Setup
Commands
Per-file WorkflowsSync just the active file (
|
| Setting | Default | Description |
|---|---|---|
i18nsmith.reportPath |
.i18nsmith/check-report.json |
Path to the report file |
i18nsmith.autoRefresh |
true |
Auto-refresh when report changes |
i18nsmith.showCodeLens |
true |
Show CodeLens actions |
i18nsmith.enableVerboseLogging |
false |
Enable verbose logging to Output channel for debugging sync/transform operations |
Development
# Install dependencies
cd packages/vscode-extension
npm install
# Compile
npm run compile
# Watch mode
npm run watch
# Run in VS Code
# Press F5 or use "Run Extension" launch config
Bundle Size
Latest dev build (esbuild) recorded a 17.6 MB dist/extension.js when running pnpm --filter i18nsmith-vscode run compile on 2025‑12‑02 after embedding Syncer + Transformer integrations.
How It Works
- The extension activates when
i18n.config.jsonor.i18nsmith/is detected - It watches for changes to the report file (default:
.i18nsmith/check-report.json) - When the report changes, it parses the JSON and creates VS Code diagnostics
- Diagnostics appear in the Problems panel and as squiggles in the editor
- CodeLens actions appear above files with issues
Report Schema
The extension expects a JSON report with this structure:
{
"actionableItems": [
{
"kind": "missing-key",
"severity": "warn",
"message": "Key 'common.greeting' is missing in locale 'fr'",
"filePath": "src/App.tsx",
"line": 10,
"column": 5,
"key": "common.greeting"
}
],
"hasConflicts": false,
"hasDrift": true
}
Integration with CI
The extension pairs well with the i18nsmith GitHub Action:
- uses: IMAGINARY9/i18nsmith@v1
with:
command: check
report-path: .i18nsmith/check-report.json
The generated report artifact can be downloaded and viewed locally with the extension.
How to test (Open testing)
Follow these steps to perform a focused open-testing session with the packaged VSIX or a locally built copy:
- Build and package the extension to a VSIX (from repo root):
pnpm install --no-frozen-lockfile
pnpm --filter i18nsmith-vscode run compile
cd packages/vscode-extension
npx -y @vscode/vsce package --out ../../i18nsmith-vscode.vsix --no-dependencies
- Install the VSIX in VS Code:
- Open VS Code → Extensions view → … → "Install from VSIX..." → choose
i18nsmith-vscode.vsix.
- Prepare a simple workspace for testing:
- Create an
i18n.config.jsonin workspace root (example below). - Add
locales/en.jsonand a test source file (see.github/workflows/test-action.ymlfor a minimal fixture).
Example i18n.config.json:
{
"sourceLanguage": "en",
"targetLanguages": ["es","fr"],
"localesDir": "./locales",
"include": ["src/**/*.tsx"]
}
- Generate a report the extension will consume:
npx i18nsmith check --report .i18nsmith/check-report.json
- Verify extension features in VS Code:
- Open a source file and confirm diagnostics appear (Problems panel + squiggles).
- Test hover preview on
t('key')calls. - Use the Command Palette to run: "i18nsmith: Run Health Check", "i18nsmith: Sync Current File", "i18nsmith: Transform Current File", and other commands listed in the Commands section.
- Try the editor context menu actions (Extract selection as translation key) and CodeLens quick actions.
Quick smoke test checklist
- Install the VSIX or run the extension in the debugger (F5).
- Open a project with
i18n.config.jsonandlocales/present. - Run
i18nsmith check --report .i18nsmith/check-report.jsonand confirm diagnostics appear. - Run
i18nsmith: Sync Current Fileandi18nsmith: Transform Current Fileto exercise UI flows. - Check the
i18nsmithOutput channel for errors.
- Smoke checks to perform:
- Confirm diagnostics refresh when
.i18nsmith/check-report.jsonis updated. - Confirm the Sync/Transform dry-run previews show expected diffs and that Apply writes changes and refreshes diagnostics.
- Confirm undo/VS Code's undo stack works after applying transforms.
If you spot runtime errors or missing behavior, capture the Output channel logs (View → Output → select "i18nsmith") and attach them to the GitHub issue.
Privacy & Telemetry
- Short statement: This extension does not collect or transmit telemetry, usage analytics, or source code to external services by default. All diagnostic data and logs remain local to the user's environment (Output channel and files in the workspace).
- Verbose logging: Enabling
i18nsmith.enableVerboseLoggingonly increases local logging to thei18nsmithOutput channel; it does not send logs to a remote server. - Opt-in uploads: If future features add optional upload or remote diagnostics, they will be explicitly documented and require opt-in consent. No automatic uploads occur without explicit, documented user action.
If your organization requires a formal privacy policy, link it from the repository homepage or add a PRIVACY.md with the required legal text.
Reporting issues & open testing feedback
- Open an issue at: https://github.com/IMAGINARY9/i18nsmith/issues
- When filing issues during open testing, please include:
- VS Code version and platform
- Extension version (found in
Help → AboutorExtensionsview) - Steps to reproduce
- Attach
.i18nsmith/check-report.json(if applicable) - The
i18nsmithOutput channel contents (copy/paste)
Label feature requests as enhancement and runtime bugs as bug to help triage. If you want a dedicated testing/discussion channel, we can add a DISCUSSION template or use GitHub Discussions.
Publishing to the Visual Studio Marketplace (automation)
An optional workflow (.github/workflows/publish-to-marketplace.yml) is included that will publish the extension when a GitHub Release is published.
Requirements:
- A repository secret named
VSCE_TOKENthat contains a Personal Access Token (PAT) for publishing to the Visual Studio Marketplace. Create the token according to the@vscode/vscedocumentation and add it to GitHub → Settings → Secrets → Actions. - Ensure the
publisherfield inpackages/vscode-extension/package.jsonmatches the Marketplace publisher id that will own the extension.
Workflow behavior and safety:
- The workflow triggers on
releaseevents (when you publish a GitHub Release). It builds the extension, runs@vscode/vsce publishusing the token, and uploads a VSIX artifact. - Publishing from a release reduces accidental publishes; we recommend creating a Draft release and verifying the produced VSIX artifact before publishing it to the Marketplace.
Manual publish alternative:
If you prefer manual publishing, you can publish locally with:
cd packages/vscode-extension
npx -y @vscode/vsce publish --pat <YOUR_TOKEN>
This will package and publish the extension using the token you provide.
Troubleshooting
- "code: command not found": enable the
codeCLI from VS Code (Cmd+Shift+P → "Shell Command: Install 'code' command in PATH") or create a symlink to the app bundle. See the project root README for exact commands. - Packaging fails (vsce errors): ensure
packages/vscode-extension/LICENSEexists and runpnpm --filter i18nsmith-vscode run compilebefore packaging. - Large bundle size: If runtime errors relate to missing modules, confirm workspace dependencies are built and that
esbuildbundles required code. Usepnpm -r buildat repo root to build workspace packages.
If you need help with any of these steps I can update the README further or add scripts to simplify packaging and local testing.