A VSCode extension to automate localization of Dart/Flutter projects using LLMs. Select files with raw text and let the AI generate .arb variables and translations for you.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
generate-l10n is a VSCode extension designed to simplify and automate the localization process for Dart/Flutter projects.
It leverages LLM models (like Mistral, OpenAI, Google) to update .dart files and amend .arb localization files.
The extension provides an interactive tree view, file selection, and direct integration with the flutter gen-l10n command.
Features
Interactive tree view of Dart files under /lib.
Check/uncheck files to include in the localization process.
Select ARB localization files for multiple languages.
Input API key for LLM provider.
Supports multiple LLM providers and models.
Automatically executes flutter gen-l10n after processing.
Full VSCode native UI integration (activity bar, command palette, tree view).
Installation
Open VSCode.
Navigate to the Extensions sidebar.
Search for generate-l10n.
Click Install.
Once installed, the L10n Generator icon appears in the activity bar.
No additional setup is required beyond the API key.
Usage
Open a Flutter/Dart project in VSCode.
Click the L10n Generator icon in the activity bar.
Expand the /lib folder tree to locate Dart files.
Check the files you want to process.
Press the Play ▶ button or run the command Process Selected Files from the command palette.
The extension will:
Use the configured LLM to modify Dart/ARB files.
Execute flutter gen-l10n in a terminal.
Notify you upon success or failure.
Configuration
Configure the extension via Settings or the configureExtension command:
Setting
Type
Default
Description
generateL10n.provider
string
"mistral"
LLM provider to use (openai, mistral, google)
generateL10n.apiKey
string
""
API key for the selected provider
generateL10n.model
string
"mistral-small-latest"
LLM model used for processing
The API key is required for the extension to function.
Commands
The extension registers the following commands:
Command
Description
generateL10n.toggleCheck
Toggle check state of a file in the tree view.
generateL10n.processSelectedFiles
Process all checked files using the configured AI provider/model.
generateL10n.configureExtension
Open extension settings for configuration.
generateL10n.refreshView
Refresh the tree view to reflect changes in the file system.
All commands are accessible via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
Tree View
Displays the /lib folder hierarchy.
Directories appear collapsible; Dart files are checkable.
Checked files are included in LLM processing.
Automatically refreshes when files are added or removed.
Excludes: node_modules, .git, /lib/l10n.
Technical Details
Written in TypeScript for VSCode extension API.
Uses the auto-l10n-ts library for Dart/ARB file processing.
Interacts with LLMs via provider APIs.
Launches Flutter commands in a VSCode terminal.
Fully modular: tree view, commands, and file processing separated for maintainability.
Troubleshooting
No workspace open: Open a Flutter project folder in VSCode.
Missing API key: Set it via Settings (generateL10n.apiKey) or Configure Extension command.
No files checked: Ensure you select at least one Dart file.
Flutter gen-l10n fails: Verify Flutter SDK is installed and added to PATH.