use platform_core::LocaleTag;
pub fn split_language_tags(tags: &str) -> Vec<LocaleTag> {
platform_core::platform_locales(
tags.split(',')
.map(str::trim)
.filter(|tag| !tag.is_empty() && *tag != "und"),
)
}
pub fn configuration_locale(language: Option<&str>, country: Option<&str>) -> Option<LocaleTag> {
let language = language.filter(|l| !l.is_empty())?;
let tag = match country.filter(|c| !c.is_empty()) {
Some(country) => format!("{language}-{country}"),
None => language.to_string(),
};
platform_core::platform_locales([tag]).pop()
}
pub fn animator_scale_reduces_motion(scale: f32) -> bool {
scale == 0.0
}
#[cfg(test)]
#[path = "preference_values.test.rs"]
mod tests;