Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.environ does not have LANGUAGE in Centos8. #544

Merged
merged 2 commits into from Dec 2, 2021
Merged

os.environ does not have LANGUAGE in Centos8. #544

merged 2 commits into from Dec 2, 2021

Conversation

xuezhixin
Copy link
Contributor

There is no LANGUAGE available on environ of centos, so there is no way to select a new LANGUAGE, even though only English is available.

@mattrose
Copy link
Member

mattrose commented Dec 1, 2021

According to my reading, LANGUAGE and LANG are two slightly different variables with slightly different purposes and LANGUAGE is present on other linuxes. I'd much rather use LANG as a fallback if LANGUAGE doesn't exist, rather than replacing LANGUAGE with LANG entirely

@xuezhixin
Copy link
Contributor Author

What you said is very reasonable, so I will add Lang as a judgment. Is it appropriate?If you think so, I will continue to revise it.

@mattrose
Copy link
Member

mattrose commented Dec 1, 2021

This is ... closer, but LANG should only ever return one element. LANGUAGE returns a colon separated list, but LANG only ever returns one language. You should be able to just use the string that split returns. so something like:

 elif 'LANG' in os.environ:
        target = os.environ['LANG'].split('.')[0]

@mattrose
Copy link
Member

mattrose commented Dec 1, 2021

just another Q: What does locale output in centos 8?

@xuezhixin
Copy link
Contributor Author

Thank you for your advice. I have revised the language selection again to facilitate the expansion of the website language in the future. Running in my environment on CentOS 8 is zh_ CN is en after changing the English is en_US.Also on Debian, language is zh_ CN.

@mattrose
Copy link
Member

mattrose commented Dec 2, 2021

Looks good, thank you!

@mattrose mattrose merged commit 00ea7e4 into gnome-terminator:master Dec 2, 2021
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.

None yet

2 participants