Function jumpy::prelude::sys_locale::get_locale
pub fn get_locale() -> Option<String>
Expand description
Returns the active locale for the system or application.
This may be equivalent to get_locales().next()
(the first entry),
depending on the platform.
§Returns
Returns Some(String)
with a BCP-47 language tag inside. If the locale
couldn’t be obtained, None
is returned instead.
§Example
use sys_locale::get_locale;
let current_locale = get_locale().unwrap_or_else(|| String::from("en-US"));
println!("The locale is {}", current_locale);