i18n: normalize LANGUAGE environment variable#10905
Open
EriksRemess wants to merge 3 commits intoghostty-org:mainfrom
Open
i18n: normalize LANGUAGE environment variable#10905EriksRemess wants to merge 3 commits intoghostty-org:mainfrom
EriksRemess wants to merge 3 commits intoghostty-org:mainfrom
Conversation
… locale by order of preference
Member
Author
|
related to PR I closed #10631 |
mitchellh
requested changes
Feb 20, 2026
Contributor
There was a problem hiding this comment.
I swear we used to have code that did this... I thought I recall finding some source in libintl that I ported over to here that did this or something similar. I don't quite know yet if this is the right approach but I will say that if it is, this does require changes:
We should pull this out into a separate function that we have a set of unit tests for (in locale.zig) that tests that a given input value is converted (or not) into the desired output value.
… locale by order of preference
Member
Author
|
@mitchellh moved into a seperate function and added tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LANGUAGE can come as en, lv:en, pt_BR:en or as lv_LV.UTF-8. This PR normalizes LANGUAGE in a form that is supported by our translations.