Debian Codegraph @

third_party/rust/sys-locale/examples/get_locale.rs

raw
1 //! A small example to run on your computer to see what locale the library returns.
2 #![allow(unknown_lints)]
3 #![allow(clippy::uninlined_format_args)]
4
5 use sys_locale::get_locale;
6
7 fn main() {
8 let locale = get_locale().unwrap_or_else(|| String::from("en-US"));
9
10 println!("The current locale is {}", locale);
11 }