| Crates.io | es-fluent-cli |
| lib.rs | es-fluent-cli |
| version | 0.6.0 |
| created_at | 2025-07-07 15:42:58.709539+00 |
| updated_at | 2026-01-16 12:03:41.118904+00 |
| description | CLI for es-fluent |
| homepage | |
| repository | https://github.com/stayhydated/es-fluent |
| max_upload_size | |
| id | 1741481 |
| size | 281,543 |
The official command-line tool for es-fluent.
This tool automatically manages your Fluent (.ftl) translation files by analyzing your Rust code. It finds types with #[derive(EsFluent)] and creates corresponding message entries, so you don't have to keep them in sync manually.
cargo install es-fluent-cli --locked
Ensure you have an i18n.toml in your crate root:
# Default fallback language (required)
fallback_language = "en-US"
# Path to FTL assets relative to the config file (required)
assets_dir = "assets/locales"
# Features to enable if the crate’s es-fluent derives are gated behind a feature (optional)
fluent_feature = ["my-feature"]
When you add new localizable structs or enums to your code, run:
cargo es-fluent generate
This will:
src/ directory.i18n/en-US/{your_crate}.ftl.
Use --dry-run to preview changes without writing them. Use --force-run to bypass the staleness cache and force a rebuild.
Same as generate, but runs in watch mode, updating FTL files as you type:
cargo es-fluent watch
To ensure all your translations are valid and no keys are missing:
cargo es-fluent check
Use --all to check all locales, not just the fallback language, --ignore <CRATE> to skip specific crates, --force-run to bypass the staleness cache.
Remove orphan keys and groups that are no longer present in your source code:
cargo es-fluent clean
Use --dry-run to preview changes without writing them. Use --all to clean all locales. Use --force-run to bypass the staleness cache.
Standardize the formatting of your FTL files using fluent-syntax rules:
cargo es-fluent format
Use --dry-run to preview changes without writing them. Use --all to format all locales.
Propagate keys from your fallback language to other languages (e.g., from en-US to fr and de), creating placeholders for missing translations:
cargo es-fluent sync
Use --locale <LANG> to sync a specific locale, or --all to sync all locales, --dry-run to preview changes without writing them.