Merge pull request #431 from joshuamegnauth54/use-lc_time_before-lang

Try LC_TIME before LANG for time localization
This commit is contained in:
Jeremy Soller 2024-09-03 08:35:46 -06:00 • committed by GitHub
commit f4dddfc364
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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