intl_localizable 0.1.4
intl_localizable: ^0.1.4 copied to clipboard
Intl localizable dart/flutter command-line application (PRIVATE PROJECT).
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. |
alive |
Checks connectivity with the gRPC backend. |
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.