| Crates.io | sys-locale |
| lib.rs | sys-locale |
| version | 0.3.2 |
| created_at | 2021-05-13 16:42:01.126928+00 |
| updated_at | 2024-11-01 18:12:28.171074+00 |
| description | Small and lightweight library to obtain the active system locale |
| homepage | |
| repository | https://github.com/1Password/sys-locale |
| max_upload_size | |
| id | 396999 |
| size | 46,751 |
A small and lightweight Rust library to get the current active locale on the system.
sys-locale is small library to get the current locale set for the system or application with the relevant platform APIs. The library is also no_std compatible, relying only on alloc, except on Linux and BSD.
Platform support currently includes:
js feature)UNIX backend)
Further support for other WASM targets is dependent on upstream
support in those target's runtimes and specifications.use sys_locale::get_locale;
let locale = get_locale().unwrap_or_else(|| String::from("en-US"));
println!("The current locale is {}", locale);
The Minimum Supported Rust Version is currently 1.56.0. This will be bumped to a newer stable version of Rust when needed.
Made with ❤️ by the 1Password team.