ferrocat
ferrocat is the public Rust crate in the ferrocat workspace.
It provides:
- PO parsing and serialization
- ICU MessageFormat parsing and serializable compilation
- Catalog compilation for serializable host bindings
- Message ID generation and plural helpers
- A Rust-only runtime module for locale-aware formatting and tag rendering
The crate is intended to be usable directly from Rust and to serve as the shared core for thin host bindings such as Node.js.
Installation
Parse and stringify PO files
use ;
let po = parse_po;
assert_eq!;
assert_eq!;
let rendered = stringify_po;
assert!;
Compile ICU messages to a serializable payload
use ;
let compiled = compile_icu
.expect;
match compiled.kind
Compile catalogs to a serializable payload
use ;
let catalog = from;
let compiled = compile_catalog
.expect;
assert_eq!;
match &compiled.entries.message.kind
Rust runtime formatting
For direct runtime formatting in Rust, use [ferrocat::runtime]. It exposes the
runtime compiler, compiled message/catalog types, and host hooks such as
FormatHost.
That keeps the crate root host-neutral for thin bindings while preserving the richer Rust-native execution model for direct integrations.