Professional internationalization management for VS Code
i18n CodeLens is a comprehensive translation management extension that streamlines localization workflows for JavaScript, TypeScript, and React projects. It provides intelligent detection of translation keys, visual indicators for missing translations, and powerful editing tools—all integrated directly into your development environment.
The extension can be customized for different project structures through configurable regex patterns and glob settings, making it adaptable to various i18n frameworks and conventions.
- 🤖 MCP Integration & Automation: Built-in MCP stdio server with rich i18n tools; auto-registers via VS Code LM API and works with Copilot Agentic, Claude for VS Code, and other MCP clients
- 🔍 Smart Translation Detection: Automatically detects translation keys in your code using configurable regex patterns
- 📋 Bulk Translation Editor: Professional WebView-based interface for editing multiple translation keys simultaneously
- 🎯 Interactive Hover Actions: Click-to-edit, add, or delete translations directly from hover popups
- 🌐 Multi-Language Support: Works with JavaScript, TypeScript, React (JSX/TSX) files
- 📊 Visual Indicators: Color-coded decorations showing translation status (missing, partial, complete)
- 🔄 Real-time Validation: Instant feedback on missing translations with CodeLens integration
- 🗂️ Resource Tree View: Organized view of all translation keys with quick navigation
- ⚡ Smart Suggestions: Auto-completion and closest-match positioning for new translations
- 🧱 Flat/Nested Awareness: Detects flat translation dictionaries and deeply nested JSON, preserving structure during edits
- 🧭 Insert Order Strategies: Control how new keys are placed in locale files — append to end, insert near the closest key (Levenshtein), or fully sort A→Z
Concise highlights only (see full details in the Change Log below):
- Model Context Protocol (MCP) integration
- Built‑in stdio server, works with Copilot/Claude via VS Code LM API
- Auto-registration in VS Code and optional standalone mode (
npm run mcp) - Key discovery tooling for smarter automation
- Enhanced JSON structure support
- Auto-detect flat vs. nested locale files and preserve structure on write
- Accurate diagnostics across CodeLens, Hover, and Tree View
- Quality improvements
- More predictable ordering,
.gitignore‑aware scans, and flexible glob/regex configuration
- More predictable ordering,
The extension includes a Model Context Protocol (MCP) stdio server for AI-powered automation.
VS Code LM API (Recommended)
The extension automatically registers with VS Code's Language Model API. Compatible clients like GitHub Copilot Agentic, Claude for VS Code, and other MCP-aware tools can invoke the tools without additional configuration.
Standalone Mode
Run npm run mcp or node ./out/mcp/server.js from the workspace root to start the MCP server independently.
Customize server behavior with these environment variables:
WORKSPACE_ROOT— Absolute path to scan (defaults to current workspace)I18N_GLOB— Pattern for resource files (defaults to**/locales/**/*.json)I18N_CODE_REGEX— Custom regex for detecting translation keysI18N_CODE_GLOB— Pattern for code files (defaults to**/*.{ts,tsx,js,jsx})I18N_IGNORE— Additional glob patterns to ignore (e.g.,**/dist/**;**/.next/**);.gitignoreis also respectedI18N_STRUCTURE— Controls write structure (auto|flat|nested)I18N_INSERT_ORDER— Controls insert order (append|nearby|sort)
Note: Auto-registration requires VS Code 1.96.0 or newer. For older versions, use standalone mode with
npm run mcp.
| Tool | Description |
|---|---|
i18n_list_locales |
Lists available locale files with normalized tags and human-friendly descriptions |
i18n_get_translations |
Retrieves translations for specified keys and locales |
i18n_upsert_translations |
Bulk add or update translations across multiple locales (supports dry-run) |
i18n_delete_key |
Removes a translation key from all locale files (supports locale filter and dry-run) |
i18n_diff_locales |
Diffs base vs. compare locales: missing/extra keys and placeholder parity |
i18n_scan_workspace_missing |
Scans code for referenced keys missing in resources and surfaces references |
i18n_rename_key |
Renames a key across all locales with collision checks (supports dry-run) |
i18n_move_namespace |
Moves a key prefix (namespace) across locales with safety checks (supports dry-run) |
i18n_validate_placeholders |
Validates placeholder consistency across locales |
These tools integrate with AI workflows to automate translation validation, identify gaps, and streamline localization management.
The extension intelligently handles both flat and nested translation file structures:
- Automatic detection: Identifies whether files use flat key-value maps or nested object hierarchies
- Internal flattening: Processes nested structures internally for search and CodeLens functionality
- Structure preservation: Maintains original formatting when writing updates to disk
- Flexibility: Edit deeply nested locale files without manual flattening, while keeping MCP automation fully functional
- Stabilized MCP registration (single supported constructor, no fallbacks, with new log channel for MCP Server)
- Non‑blocking logging with graceful console fallback
- Useful diagnostics: startup config + per‑tool success/error with durations
- Fixed: MCP duplicate tool registrations in GitHub Copilot Chat by pruning stale/invalid
mcpServersentries and keeping only the current server path at activation. - Improved: More robust MCP provider lifecycle (re-register/dispose) with safer error handling.
- Note: After upgrading, use “Developer: Reload Window”. If duplicates persist, remove old entries under
github.copilotChat.mcpServersonce in Settings (JSON).
- Added:
resourceInsertOrderStrategysetting with configurable strategies (append,nearby,sort) so you decide how new translations are positioned;nearbyuses closest-match heuristics by default. - Added:
I18N_INSERT_ORDERenvironment variable and MCP wiring to keep Copilot/Inspector automation aligned with the chosen insert strategy. - Improved: Translation writes (flat or nested JSON) preserve original ordering unless explicit alphabetical sorting is requested, preventing unexpected churn in locale files.
- Improved: Shared ordering utilities reuse the same Levenshtein-based placement logic across extension actions and MCP tools for consistent behaviour.
- Added: Model Context Protocol stdio server with five automation tools and VS Code LM auto-registration
- Added: Automatic detection of nested translation files with safe flatten/unflatten helpers
- Added:
overviewRulerMarkerssetting for scroll bar indicators - Improved: Resource sorting and
.gitignorehandling for stable results across features - Improved: Manual MCP usage via
npm run mcpand environment overrides - Improved: Cleaner scroll bar with smart indicators - only problematic translations are highlighted
- Updated: Minimum VS Code version to
^1.96.0to enable LM/MCP integration
- Enhanced: Logger system with structured log levels (debug, info, warn, error) and configurable
logLevelsetting - Added: New
codeFileRegexsetting for customizable code file pattern matching (default:/\.(jsx?|tsx?)$/) - Added:
.gitignoreintegration for file filtering during workspace scanning - Improved: Resource scanning performance with optimized regex handling and execution patterns
- Improved: Code file detection with proper filtering of ignored files and relative path handling
- Enhanced: Input dialogs with VS Code InputBox API, step progress indicators, and validation feedback
- Enhanced: Hover provider with improved layout, inline edit actions, and action links
- Enhanced: Error handling with proper categorization and user-friendly error messages
- Fixed: Type error in
ResourceTreeViewProvider.tsrelated to range character access - Fixed: Function closure issue in
ActionResetAndReloadExtension.tserror handling - Fixed: Code action provider regex matching to use appropriate code detection pattern
- Fixed: Resource line regex execution with proper global flag handling
- Updated: Dependencies -
fastest-levenshteinto v1.0.16 and addedignorev7.0.5 - Updated: TypeScript configuration to ES2020 target with enhanced module resolution
- Major Feature: Added comprehensive bulk translation editing system with WebView interface
- Enhanced: Hover provider with interactive edit/add/delete action links
- Improved: JSON-safe file operations preventing trailing comma corruption
- Added: Source file tracking for bulk edit operations
- Enhanced: Error handling and logging throughout the extension
- Extended: Language support for React files (JSX/TSX)
- Fixed: WebView modal restrictions with custom confirmation dialogs
- Improved: Resource tree view performance and reliability
- Internal RegExp & Glob Pattern updated to support better matching
- Multiple resource key detection fixed at single line for Hover and Code Action Providers
- Logs forwarded to custom i18n CodeLens output channel
- Minor fixes
Performance tweaks & refactored with new features
- Resource Tree view added to Explorer with new configs
- Similar providers centralized
- All settings and reloading data moved to SettingUtils
- Resource delete action added for Code or Resource file
- Action & Configuration settings renamed properly
- Resource hover text fixed after save
- Fix: Missing glob validation added to show properly
- Definition Provider added so that language resource references can be found with 'go to definition' command or Ctrl+click
- Unused resources now show as half-transparent and give hover information on
.jsonlanguage resource files
- Initial release
| Setting | Description | Default |
|---|---|---|
codeLens |
Enable CodeLens indicators for missing translations | true |
underlineCodeDecorator |
Show underline decorations for missing translations | true |
overviewRulerMarkers |
Show scroll bar markers for problematic translations (warnings/errors only) | true |
resourceAutoSave |
Auto-save resource files after edits | true |
autoFocusAfterModified |
Focus editor on modified resource files | false |
| Setting | Description | Default |
|---|---|---|
resourceTreeViewVisible |
Display Resource Tree View in Explorer | true |
revealResourceInTreeView |
Auto-reveal selected resources in Tree View | false |
| Setting | Description | Default |
|---|---|---|
resourceFilesGlobPattern |
Glob pattern for locating translation files | **/locales/**/*.json |
codeFilesGlobPattern |
Glob pattern used to scan code files for i18n references | **/*.{ts,tsx,js,jsx} |
resourceCodeDetectionRegex |
Regex for detecting translation keys in code | See below |
codeFileRegex |
Pattern for identifying code files | `/.(jsx? |
ignoreGlobs |
Additional ignore globs for scans (both code and resources) | ['**/node_modules/**'] |
resourceStructureStrategy |
Write structure: auto, flat, or nested |
auto |
resourceInsertOrderStrategy |
Insert order: append, nearby, or sort |
nearby |
Default detection regex:
(?<=\/\*\*\s*?@i18n\s*?\*\/\s*?["']|\W[tT]\(\s*["'])(?<key>[A-Za-z0-9 .-_]+?)(?=["])
This matches:
t('key')orT('key')— Function call patterns/** @i18n */ 'key'— Comment annotation pattern
| Setting | Description | Default |
|---|---|---|
logLevel |
Control extension log verbosity (debug, info, warn, error, off) |
warn |
The extension automatically detects translation keys using these patterns:
// Function call patterns
t('welcome.message') // lowercase
T('user.greeting') // uppercase
// JSX/TSX usage
<Text>{t('button.submit')}</Text>
// Annotation pattern
/** @i18n */ 'settings.title'Add Missing Translations
- Hover over any translation key with missing translations
- Click "Add Translations" in the hover popup
- Enter translations for each required language
- Files are saved automatically (if
resourceAutoSaveis enabled)
Edit Existing Translations
- Hover over a translation key
- Click "Edit Translations"
- Modify values for any language
- Changes are applied instantly
Delete Translations
- Hover over a translation key
- Click "Delete Translations"
- Confirm removal
- Key is removed from all locale files
For efficient multi-key editing:
- Open a file containing multiple translation keys
- Hover over any key and click "📋 Bulk Edit (X keys)"
- The visual editor opens with all keys from the current file
- Edit, add, or delete multiple translations simultaneously
- Click Save to apply all changes at once
Go to Definition
Ctrl+Click (or Cmd+Click) on any translation key to jump to its definition in locale files.
Resource Tree View
View all translations used in the active file organized by key, with visual indicators for:
- ✅ Complete translations (all languages present)
⚠️ Partial translations (some languages missing)- ❌ Missing translations (key not found)
Issues and feature requests are welcome! Please check the GitHub repository for more information.
This project is licensed under the MIT License.

