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

X11 shell locale detection #1756

Merged
merged 3 commits into from
May 4, 2021
Merged

X11 shell locale detection #1756

merged 3 commits into from
May 4, 2021

Conversation

maan2003
Copy link
Collaborator

@maan2003 maan2003 commented May 3, 2021

Based on gettext manual.

Also on Linux, there is a priority list of locales rather than a single locale. Not sure if Application::get_locale should return a priority list.

Fixes: #938

based on gettext manual
@maan2003 maan2003 added S-needs-review waits for review shell/x11 concerns the X11 backend labels May 3, 2021
// the value is priority list seperated by :
// See: https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html#The-LANGUAGE-variable
.and_then(|locale| locale.split(':').next().map(String::from))
.unwrap_or_else(|| "en-US".to_string())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a difference between "en-US" and "en_US"? My system uses the latter...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is better idea to en_US. I used en-US because it was used in the stub earlier.

Copy link
Member

Choose a reason for hiding this comment

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

The identifiers can vary in case and in the separator characters. The "-" and "_" separators are treated as equivalent, although "-" is preferred.

(from Unicode TR #35)

druid-shell/src/platform/x11/application.rs Outdated Show resolved Hide resolved
@SecondFlight SecondFlight added S-ready PR is ready to merge and removed S-needs-review waits for review labels May 4, 2021
@maan2003 maan2003 merged commit 8e83610 into linebender:master May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-ready PR is ready to merge shell/x11 concerns the X11 backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

X11 shell does not use the platform locale.
4 participants