intl_localizable 0.0.30
intl_localizable: ^0.0.30 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. |
Global Options #
| Option | Shorthand | Description | Default |
|---|---|---|---|
--input-path |
-i |
Target project directory containing localizable_project.json and pubspec.yaml. |
Current directory (.) |
--output-path |
-o |
Output directory where extracted localization files will be saved. | Same as --input-path |
--version |
-v |
Display the current CLI tool version. | — |
--help |
-h |
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.