Registry / utility / fluent-bundle

fluent-bundle

JSON →
library0.16.0rscratesunverified

Provides a low-level implementation of a collection of localization messages for a single locale for Project Fluent.

# Cargo.toml [dependencies] fluent-bundle = "0.16.0"
INSTALL
IMPORT
SIG · FLUENT-BUNDLE
F
fluent-bundle
utilityrustv0.16.0
harness data pending
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.

Agent activity
2 hits · last 30 days
node
2
Resources
fluent-bundle — cargo add fluent-bundle · libregistry