Streamlines the Flutter l10n workflow by detecting and refactoring hardcoded strings.
1. Project-Wide Scan (Flutter L10n Overview)
Global string detection: Adds a sidebar view that scans your lib folder and lists every Dart file containing hardcoded strings.
Custom scan scope:
Filter directories (dartL10n.filterDir): Limit the scan to specific subdirectories (for example lib/features/profile) to focus on a single feature.
Ignore files or folders (dartL10n.ignoreFile): Temporarily or permanently exclude files or directories from the scan results.
One-click navigation: Select any item to open the file and jump directly to the detected string.
2. String Refactoring (Quick Fix)
CodeLens quick fix: Shows a 🔧 Fix「...」to l10n button above each detected string; click to start refactoring.
Code Action support: Select a string (without quotes) and trigger 🌐 Export String to l10n resource with Ctrl + ..
Key suggestions: Automatically detects the surrounding class or file name, converts it to snake_case (for example my_widget_title), and suggests it as the l10n key.
Parameter detection:
Recognizes variables inside strings (for example "Hello $name" or "Total: ${count}").
Prompts for parameter types (String or num) whenever a variable is found.
Generates the placeholders section in .arb files automatically.
Automatic code replacement:
Replaces "My String" with context.l10n.my_string.
Replaces "Hello $name" with context.l10n.hello_name(name).
context.l10n helper:
Checks for and creates localization_extension.dart so the context.l10n getter is always available.
Adds required import statements to the top of the Dart file.
3. .arb File Automation
Auto-sort on save: Validates JSON and sorts entries whenever you save an .arb file:
appName (if present)
All keys without matching @ metadata (alphabetical)
Each key with its @key pair (alphabetical)
Automatic flutter gen-l10n runs:
Whenever a new l10n key is created through refactoring.
Whenever an .arb file is saved manually.
Executes flutter gen-l10n in the terminal to keep AppLocalizations.dart up to date.
4. Active File Analysis (Flutter L10n Detector)
Real-time analysis view: Adds another sidebar view dedicated to the currently open Dart file.
String categorization:
[Fix]: Strings that should be refactored to l10n resources.
[Log]: Strings inside log(...) or Logger(...).
[Print]: Strings inside print(...).
[Other]: Strings recognized as constants, route paths (/), Key(), or DateFormat().
Tag filters: Quickly filter the list, for example to show only [Fix] items.
5. Localization Editor
Unified editing view: Provides a webview editor to manage all .arb files in one place.
Two display modes:
Combined View: Displays all languages side-by-side in a single table for easy comparison.
Tabbed View: Shows translations for one language at a time, simplifying focused editing.
Advanced filtering:
Filter by key or value: Quickly find specific translations.
Placeholder-only filter: Isolate entries that contain variables.