Skip to content

Comments

i18n: normalize LANGUAGE environment variable#10905

Open
EriksRemess wants to merge 3 commits intoghostty-org:mainfrom
EriksRemess:fix-LANGUAGE
Open

i18n: normalize LANGUAGE environment variable#10905
EriksRemess wants to merge 3 commits intoghostty-org:mainfrom
EriksRemess:fix-LANGUAGE

Conversation

@EriksRemess
Copy link
Member

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.

@EriksRemess
Copy link
Member Author

related to PR I closed #10631

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

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

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.

@EriksRemess
Copy link
Member Author

@mitchellh moved into a seperate function and added tests

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