5 releases
0.2.4 | Mar 7, 2023 |
---|---|
0.2.3 | Nov 6, 2022 |
0.2.1 | Jun 17, 2022 |
0.2.0 | Mar 1, 2022 |
0.1.0 | May 13, 2021 |
#11 in Internationalization (i18n)
60,491 downloads per month
Used in 63 crates
(19 directly)
18KB
330 lines
sys-locale
A small and lightweight Rust library to obtain the locale the active locale on the system.
sys-locale
is small library for obtaining 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:
- Android
- iOS
- macOS
- Linux, BSD, and other UNIX variations
- WebAssembly
- Windows
use sys_locale::get_locale;
let locale = get_locale().unwrap_or_else(|| String::from("en-US"));
println!("The current locale is {}", locale);
MSRV
The Minimum Supported Rust Version is currently 1.48.0. This will be bumped to the latest stable version of Rust when needed.
Credits
Made with ❤️ by the 1Password team.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~0–7.5MB
~125K SLoC