Advanced i18n CodeLens with bulk translation editing, interactive hover actions, and comprehensive language resource management for JavaScript, TypeScript, and React projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
i18n CodeLens makes it easy to find missing language resources, provides various Code Actions, Hover Information, and tips for you to add or edit the language resources.
It can be made to work in various projects by changing the regex information and glob pattern.
✨ Key Features
🔍 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
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
v1.0.6
Internal RegExp & Glob Pattern updated to support better matching
v1.0.5
Multiple resource key detection fixed at single line for Hover and Code Action Providers
v1.0.4
Logs forwarded to custom i18n CodeLens output channel
Minor fixes
v1.0.3
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
v1.0.2
Fix: Missing glob validation added to show properly
v1.0.1
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 .json language resource files
v1.0.0
Initial release
Settings
codeLens
Enable or disable the CodeLens for missing resource code. Default: true
resourceAutoSave
Enable auto save for resource file(s) that saves files after inserted or updated resource data. Default: true
underlineCodeDecorator
Enable or disable the underline decorator for missing resource code(s). Default: true
autoFocusAfterModified
Enable auto focus document after inserted or updated target resource file(s). Default: false
revealResourceInTreeView
Enable or disable the automatic reveal resource item in the Resource Tree View when selected resource file on the editor. Default: false
resourceTreeViewVisible
Enable or disable the Resource Tree View. Default: true
resourceFilesGlobPattern
Language file glob patterns (Language resource files must be key value object files). Default: **/locales/**/*.json
resourceCodeDetectionRegex
Regular expression pattern to identify resource keys for hover information and CodeLenses. The default pattern matches: t('key'), T('key'), or keys preceded by /** @i18n */ comment. Default: (?<=\/\*\*\s*?@i18n\s*?\*\/\s*?["']|\W[tT]\(\s*["'])(?<key>[A-Za-z0-9 .-]+?)(?=["'])
codeFileRegex
Regular expression pattern to identify code files for translation keys. Default: /\.(jsx?|tsx?)$/
logLevel
Controls the log level of the i18n CodeLens extension. Set to 'debug' for more verbose logs. Default: warn
📖 Usage Examples
Basic Translation Detection
// These patterns will be detected automatically:
t('welcome.message') // Function call pattern
T('user.name') // Uppercase function pattern
/** @i18n */ 'button.submit' // Comment annotation pattern
Bulk Editing Workflow
Open any file with multiple translation keys
Hover over any translation key
Click "📋 Bulk Edit (X keys)" link
Edit all translations in the visual interface
Save or delete multiple keys at once
Resource Management
Add: Hover over missing translation → Click "Add Translations"
Edit: Hover over existing translation → Click "Edit Translations"
Delete: Hover over any translation → Click "Delete Translations"
Bulk Operations: Use bulk editor for multiple keys
🤝 Contributing
Issues and feature requests are welcome! Please check the GitHub repository for more information.