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
Makes Dutch language file default to U.S. keyboard layout #1954
Conversation
I did a test with this patch, and indeed it keeps the US layout. But it also causes this error in the log:
In addition to testing with nl_NL.UTF-8 as locale, I tested with:
This is the Belgium Dutch (Flemish) locale. This also came up with a US layout, which is actually not correct as it should use the Belgium layout. For those not in the know, Belgium has three locales. nl_BE.UTF-8, fr_BE.UTF-8 and de_BE.UTF-8. Basically Dutch, French and German. But all 3 use the same French-style keyboard layout (AZERTY). |
Some further testing reveals more issues with keyboard layouts. Switzerland has 4 locales and 2 keyboard layouts (Swiss-German and Swiss-French). When starting with Swiss-Italian (it_CH) should default to the Swiss-French keyboard, and Swiss-Romansh (rm_CH) should default to the Swiss-German keyboard. And then you may think that a country as tiny as Luxembourg would be easy. It only has 2 locales (fr_LU and de_LU). But it does not have it's own keyboard layout. Instead it uses Belgium, French and German keyboards in addition to Swiss-French keyboards commonly found in schools and government institutions. Try to guess the layout... |
Currently the chunk of code that parses LANG= only takes the first-two letters (the language component), and skips the rest. This was a deliberate choice back when LANG's only purpose was load one of our 5 translations (de, es, it, po, ru). This should be expanded into handling both the language and country components, and then flowed into the layout and other settings on start-up. |
@rderooy , right now only the language is fetched from the LANG= variable. If we get the second country code from the LANG= as well, how should this play into these conf settings: [dos]
# country: Set DOS country code which will affect country-specific
# information such as date, time, and decimal formats.
# If set to 0, the country code corresponding to the
# selected keyboard layout will be used.
# keyboardlayout: Language code of the keyboard layout (or none).
country = 0
keyboardlayout = auto I think we want to follow the general software approach of "near/specific" variables trump "distant/general" variables. So if the conf's But if country and/or layout are customized inside the conf, then those should take priority over the LANG. |
Relying on the LANG variable to "guess" the keyboard layout is very much hit and miss. A few ways to check keyboard layout on Linux that I am aware of. This seems to return the current keyboard layout, but requires X11 (or XWayland) to be present $ setxkbmap -query
rules: evdev
model: pc105
layout: us This uses systemd, but returns the default "system" layout, and may not reflect the currently set layout for the user.
|
0b7999c
to
e35dcc5
Compare
e35dcc5
to
818f1b3
Compare
@rderooy The log message |
Looks great, @Wengier! |
This intends to solve #1951 as reported by @rderooy by making the Dutch language file default to the U.S. keyboard layout, since as mentioned in the issue Dutch keyboard layouts are very rarely used in the Netherlands.