From 02ce77c86339b5d6bcce90c3bf4dc0e9f724bf22 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Thu, 8 Oct 2026 00:37:16 +0200 Subject: [PATCH] unix: Fix lang selection with an empty LANGUAGE env var --- crates/edit/src/sys/unix.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/edit/src/sys/unix.rs b/crates/edit/src/sys/unix.rs index 46bd4546058..a1e8e9abf5c 100644 --- a/crates/edit/src/sys/unix.rs +++ b/crates/edit/src/sys/unix.rs @@ -561,7 +561,7 @@ where pub fn preferred_languages(arena: &Arena) -> BVec<'_, &'_ str> { let mut locales = BVec::empty(); - for key in ["LANGUAGE", "LC_ALL", "LANG"] { + for key in ["LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG"] { if let Ok(val) = std::env::var(key) && !val.is_empty() { @@ -574,7 +574,9 @@ pub fn preferred_languages(arena: &Arena) -> BVec<'_, &'_ str> { } locales.extend_sloppy(arena, val.split(':').filter(|s| !s.is_empty())); - break; + if !locales.is_empty() { + break; + } } }