Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FluentBundle
✓ use fluent_bundle::FluentBundle;
Creates a FluentBundle, adds a resource, and formats a message.
use fluent_bundle::{FluentBundle, FluentResource};
use unic_langid::langid;
fn main() {
let langid = langid!("en-US");
let mut bundle = FluentBundle::new(vec![langid]);
let res = FluentResource::try_new("hello = Hello, world!".to_string()).unwrap();
bundle.add_resource(res).unwrap();
let msg = bundle.get_message("hello").unwrap();
let pattern = msg.value().unwrap();
let value = bundle.format_pattern(pattern, None, &mut vec![]);
println!("{}", value);
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.16.0latest on crates.io
Audit
Dependencies
No dependency data recorded yet.