intl_localizable
A command-line tool for Dart and Flutter that streamlines synchronizing, generating, and distributing localization files from the Localizable platform directly into your codebase.
Features
- 🚀 One-Command Sync: Fetch and unpack the latest localization exports with
localizable update. - 🔍 Automatic Project Detection: Automatically detects whether your project is Flutter or Pure Dart and exports the corresponding localization files.
- 📁 Smart Path Resolution: Intelligently places generated files into
lib/src/(if present) orlib/. - 📦 Automated Dependency Management: Automatically checks your
pubspec.yamland adds or updates theintldependency if needed. - ⚡ gRPC-Powered: Fast and secure streaming export delivery via gRPC.
Installation
Activate the CLI globally using the Dart SDK:
dart pub global activate intl_localizable
Tip
Ensure that your global pub cache bin directory is in your system's PATH:
- macOS / Linux:
~/.pub-cache/bin - Windows:
%LOCALAPPDATA%\Pub\Cache\bin
Configuration
In the root of your Dart or Flutter project, Download the localizable_project.json configuration file by using the "Download CLI config" in the "Exports" section button of the localization-platform project:
{
"id": "<YOUR_PROJECT_ID>",
"jws": "<YOUR_JWS_AUTH_TOKEN>"
}
| Field | Description |
|---|---|
id |
The unique identifier of your project in the Localizable platform. |
jws |
The JSON Web Signature (JWS) authentication token used to authorize export requests. |
Usage
Run the tool from the root directory of your project:
localizable update
Commands
| Command | Description |
|---|---|
update |
Request a new localization export from the server and extract it into your project. |
init |
Installs LOCALIZABLE.md in the project root with complete instructions for LLM agents. |
project |
Manage projects, configurations, and exports. |
translation |
Manage translation keys (snake_case). |
localization |
Manage localized texts for keys. |
variable |
Manage variables for translations (camelCase, plurals, genders, dates, numbers). |
variable-localization |
Manage localized values for variables. |
tag |
Manage tags and tag associations. |
translate |
Machine-translate text between locales. |
issue |
Inspect translation validation issues and warnings. |
export |
Download project export archives. |
locale |
List supported languages and locale details. |
group |
Manage workspace groups. |
user |
Manage current user account. |
Global Options
| Option | Shorthand | Status | Description | Default |
|---|---|---|---|---|
--input-path |
-i |
Optional | Target project directory containing localizable_project.json and pubspec.yaml. |
Current directory (.) |
--output-path |
-o |
Optional | Output directory where extracted localization files will be saved. | Same as --input-path |
--user-config |
— | Optional | Path to localizable_user.json configuration file. |
Auto-detected |
--user-key |
— | Optional | Direct user account JWS authentication key. | — |
--project-config |
— | Optional | Path to localizable_project.json configuration file. |
Auto-detected |
--project-key |
— | Optional | Direct project JWS authentication key. | — |
--project-id |
— | Optional | Target project ID. | Inferred from localizable_project.json |
--json |
— | Optional | Output command results in structured JSON format (recommended for LLMs and scripts). | — |
--debug |
-d |
Optional | Use localhost backend config for testing. | — |
--version |
-v |
Optional | Display the current CLI tool version. | — |
--help |
-h |
Optional | Display usage instructions and options. | — |
Examples
Run in current directory
localizable update
Specify custom project directory
localizable update --input-path ~/workspace/my_flutter_app
Specify custom output location
localizable update -i ./ -o ./packages/core_ui
How It Works
- Detects Project Type: Inspects
pubspec.yamlto determine whether the target application is a Flutter app or a Pure Dart package. - Authenticates & Exports: Reads
localizable_project.jsonand connects via gRPC to request an export archive for the given project ID. - Extracts Code: Extracts the relevant Dart/Flutter localization files directly into
lib/orlib/src/. - Validates Dependencies: Checks
pubspec.yamland ensures the requiredintldependency is present. - Cleans Up: Deletes temporary export archives and finishes execution.
Troubleshooting
Could not find pubspec.yaml in this directory: Make sure you runlocalizable updatefrom your project root or provide--input-path.Unable to read/locate localizable_project.json config file: Ensurelocalizable_project.jsonis located in your project root or the specified--input-path.command not found: localizable: Verify that Dart's global bin path (~/.pub-cache/bin) is added to your environment'sPATH.
License
This project is licensed under the terms described in the LICENSE file.
Libraries
- commands/base_command
- commands/group_command
- commands/init_command
- commands/issue_command
- commands/locale_command
- commands/localization_command
- commands/project_command
- commands/tag_command
- commands/translate_command
- commands/translation_command
- commands/update_command
- commands/user_command
- commands/variable_command
- commands/variable_localization_command
- config
- generated/alive.pb
- generated/alive.pbenum
- generated/alive.pbgrpc
- generated/alive.pbjson
- generated/config.pb
- generated/config.pbenum
- generated/config.pbgrpc
- generated/config.pbjson
- generated/export.pb
- generated/export.pbenum
- generated/export.pbgrpc
- generated/export.pbjson
- generated/group.pb
- generated/group.pbenum
- generated/group.pbgrpc
- generated/group.pbjson
- generated/locale.pb
- generated/locale.pbenum
- generated/locale.pbgrpc
- generated/locale.pbjson
- generated/project.pb
- generated/project.pbenum
- generated/project.pbgrpc
- generated/project.pbjson
- generated/project_import.pb
- generated/project_import.pbenum
- generated/project_import.pbgrpc
- generated/project_import.pbjson
- generated/tag.pb
- generated/tag.pbenum
- generated/tag.pbgrpc
- generated/tag.pbjson
- generated/translate.pb
- generated/translate.pbenum
- generated/translate.pbgrpc
- generated/translate.pbjson
- generated/translation.pb
- generated/translation.pbenum
- generated/translation.pbgrpc
- generated/translation.pbjson
- generated/translation_issue.pb
- generated/translation_issue.pbenum
- generated/translation_issue.pbgrpc
- generated/translation_issue.pbjson
- generated/translation_localization.pb
- generated/translation_localization.pbenum
- generated/translation_localization.pbgrpc
- generated/translation_localization.pbjson
- generated/user.pb
- generated/user.pbenum
- generated/user.pbgrpc
- generated/user.pbjson
- generated/variable.pb
- generated/variable.pbenum
- generated/variable.pbgrpc
- generated/variable.pbjson
- generated/variable_localization.pb
- generated/variable_localization.pbenum
- generated/variable_localization.pbgrpc
- generated/variable_localization.pbjson
- intl_localizable
- project_config
- project_type
- providers
- services/export_service
- services/project_config_service
- services/project_service
- services/version_check_service
- templates/agent_doc_template
- user_config
- version