Try LC_TIME before LANG for time localization

This commit is contained in:
Josh Megnauth 2024-09-01 01:30:04 -04:00
parent d923efa5de
commit 0c7280ab01
No known key found for this signature in database
GPG key ID: 70813183462EFAD3

View file

@ -41,7 +41,8 @@ pub static LANGUAGE_SORTER: Lazy<Collator> = Lazy::new(|| {
}); });
pub static LANGUAGE_CHRONO: Lazy<chrono::Locale> = Lazy::new(|| { pub static LANGUAGE_CHRONO: Lazy<chrono::Locale> = Lazy::new(|| {
std::env::var("LANG") std::env::var("LC_TIME")
.or_else(|_| std::env::var("LANG"))
.ok() .ok()
.and_then(|locale_full| { .and_then(|locale_full| {
// Split LANG because it may be set to a locale such as en_US.UTF8 // Split LANG because it may be set to a locale such as en_US.UTF8