mod current;
mod number;
mod plural;
mod render;
pub use current::{get_current_locale, set_current_locale};
pub use number::{Number, NumberArg};
pub use plural::Category;
pub use render::render;
pub(crate) fn parse_icu_locale(code: &str) -> icu_locale_core::Locale {
code.parse()
.unwrap_or_else(|_| icu_locale_core::langid!("en").into())
}
#[derive(Clone, Copy, Debug)]
pub enum Node {
Text(&'static str),
Var(&'static str),
Plural {
var: &'static str,
ordinal: bool,
arms: &'static [(plural::PluralArm, &'static [Node])],
},
Select {
var: &'static str,
arms: &'static [(&'static str, &'static [Node])],
},
}
pub use plural::PluralArm;
pub enum Value<'a> {
String(&'a str),
Number(&'a NumberArg),
}