sys-locale 0.1.0

Small and lightweight library to obtain the active system locale
Documentation

sys-locale

crates.io version crate documentation MSRV crates.io downloads CI

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 by default, only relying on alloc.

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.46.0. This will be bumped to the latest stable version of Rust when needed.

Credits

Made with ❤️ by the 1Password team.

License