pub trait Strings: Send + Sync {
// Required method
fn get(&self, key: &str) -> Option<String>;
// Provided methods
fn get_args(&self, key: &str, args: &[(&str, Arg<'_>)]) -> Option<String> { ... }
fn language(&self) -> &str { ... }
fn number(&self, value: f64, decimals: usize) -> Option<String> { ... }
fn quantity(&self, number: &str, unit: &str) -> Option<String> { ... }
}Expand description
Gives the text of a key in the current language, if it has one.
Required Methods§
Provided Methods§
Sourcefn get_args(&self, key: &str, args: &[(&str, Arg<'_>)]) -> Option<String>
fn get_args(&self, key: &str, args: &[(&str, Arg<'_>)]) -> Option<String>
The text for a key with its arguments placed; None falls back
to English. By default Strings::get with its { $name }
placeholders filled; a provider formatting its own (plurals,
numbers) overrides it.
Text arguments (Arg::Str) are placed verbatim; only numbers
(Arg::Num) may be formatted.