Skip to content

unix: Fix lang selection with an empty LANGUAGE env var - #984

Merged
Dustin L. Howett (DHowett) merged 1 commit into
mainfrom
dev/lhecker/sys-unix-fixes-lang
Oct 7, 2026
Merged

Dustin L. Howett (DHowett) merged 1 commit into
mainfrom
dev/lhecker/sys-unix-fixes-lang

Conversation

@lhecker

Copy link
Copy Markdown
Member

No description provided.

let mut locales = BVec::empty();

for key in ["LANGUAGE", "LC_ALL", "LANG"] {
for key in ["LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG"] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't see how this does anything about LANGUAGES being empty :D

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay okay this one is a drive-by. Technically we need to respect LC_MESSAGES for UI localization.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No i mean. To be fair. I don't see how "bail out when locales is populated" later is a fix for LANGUAGES being empty either. If LANGUAGES is empty, it's still going to go around the loop more times.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine w/ the drive-by fixes in general

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh duh, when I wrote "empty" I was talking about the filter() chain in the iterator. The issue is when it contains BS like LANGUAGE=":". In fact it may even be worth a thought to not break at all. Another thing I was thinking about is filtering out locales like "C", but they already fall back to en-US since that doesn't match anything.

In any case, this PR is the most trivial of all of them haha.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, I get it. Yeah it's funny that I'm hung up on the simplest one

@DHowett
Dustin L. Howett (DHowett) merged commit a820b05 into main Oct 7, 2026
6 checks passed
@DHowett
Dustin L. Howett (DHowett) deleted the dev/lhecker/sys-unix-fixes-lang branch October 7, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants