Function jumpy::prelude::sys_locale::get_locales
pub fn get_locales() -> impl Iterator<Item = String>Expand description
Returns the preferred locales for the system or application, in descending order of preference.
§Returns
Returns a Vec with any number of BCP-47 language tags inside.
If no locale preferences could be obtained, the vec will be empty.
§Example
use sys_locale::get_locales;
let mut locales = get_locales();
println!("The most preferred locale is {}", locales.next().unwrap_or("en-US".to_string()));
println!("The least preferred locale is {}", locales.last().unwrap_or("en-US".to_string()));