pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 8:43 am

Hello,

I'm new to the Raspberry Pi and like Raspbian a lot so far. It's a great spin on LXDE.

So, I'm not 100 % this is the right place for suggestions, but here it comes:

I would very much prefer if you could set up system language, keyboard layouts and timezone as three different things.

As a french person living in Switzerland and using a German (like in Germany German) keyboard, it is very important to me to be able to set these things up seperately. I want my system language to be English, my keyboard German (with option to switch on the fly to Swiss German) while having the timezone of Zurich. Assuming my system from the Locale leads to having to endlessly tweaking until it works, because some of the changes I later make don't seem to work or are forgotten at next boot. This kind of inconsistent behaviour is one reason I ditched Windows 8/10 for Linux, as it would just decide for me and do what it wants, leading to constantly having to readjust. I've seen other Linux distros do the same thing as Raspbian by just asking for the locales to set up everything and that usually drives me away, because I know that it's never good news for me.

So right now, I've set up the LXDE widget in the panel to switch between layouts and I'll hope it will still work after the next boot; I have not been able to change the language of the menus and system though. It still is using German, even though I want it to be English.

If anyone can tell me how to change the language, please respond. I tried using raspi-config, but it didn't really do what I thought it would (I added the British Locale).

Devs:
Please, consider languages, keyboard layouts and timezones as different things. People with multicultural backgrounds would appreciate. (My gf from Scotland approves of this too.)

DirkS
Posts: 9065
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 9:26 am

pb82 wrote:
Fri Jul 20, 2018 8:43 am
I would very much prefer if you could set up system language, keyboard layouts and timezone as three different things.
Have you seen the 'localisation' tab of the Pi configuration utility?
And you can always use the command line utilities to do the same...

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 9:38 am

DirkS wrote:
Fri Jul 20, 2018 9:26 am
pb82 wrote:
Fri Jul 20, 2018 8:43 am
I would very much prefer if you could set up system language, keyboard layouts and timezone as three different things.
Have you seen the 'localisation' tab of the Pi configuration utility?
And you can always use the command line utilities to do the same...
I have and it doesn't help, sadly. Language environment is set as English (GB), but PIXEL is all in German (except for those entries I suppose were not translated and are therefore still in English ) and the terminal is using German as well. Also, even though I had made changes in there about the keyboard layout being German, after booting it was Swiss German. Maybe I'll have to delete the Swiss Locale in raspi-config to have it all set up correctly.

EDIT: I just tried to uncheck the Swiss Locale in raspi-config and it returned an error. After reboot, PIXEL is still in German and on the terminal, I get error messages. Like so:

Code: Select all

bash: warning: setlocale: LC_ALL: cannot change locale (de_CH.UTF-8)
and when I run raspi-conif I can see that Swiss-German is unchecked, but I get error messages and this on terminal after closing raspi-config:

Code: Select all

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:	
	LANGUAGE = "de_CH.UTF-8",
	LC_ALL = "de_CH.UTF-8",
	LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Maybe I can heal this by diving deeper into the locale settings via cli, if anyone has pointers, I will be glad.

But, yeah, my point still stands: These things should be easily set seperately and all this tweaking is annoying. At least, the PIXEL widget for switching keyboard layouts is still there after reboot. The language being set to German is annoying, but less so than the keyboard being reset to another layout.

fruitoftheloom
Posts: 17489
Joined: Tue Mar 25, 2014 12:40 pm

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 9:52 am

pb82 wrote:
Fri Jul 20, 2018 9:38 am
DirkS wrote:
Fri Jul 20, 2018 9:26 am
pb82 wrote:
Fri Jul 20, 2018 8:43 am
I would very much prefer if you could set up system language, keyboard layouts and timezone as three different things.
Have you seen the 'localisation' tab of the Pi configuration utility?
And you can always use the command line utilities to do the same...
I have and it doesn't help, sadly. Language environment is set as English (GB), but PIXEL is all in German (except for those entries I suppose were not translated and are therefore still in English ) and the terminal is using German as well. Also, even though I had made changes in there about the keyboard layout being German, after booting it was Swiss German. Maybe I'll have to delete the Swiss Locale in raspi-config to have it all set up correctly.

PIXEL is no longer the default desktop environment, therefore are you running Raspbian Jessie ?

Raspbian is a fork of Debian ARMHF Operating System.

Raspberry Pi Desktop (replaced PIXEL) is a fork of LXDE.


May I suggest you run the latest release of Raspbian Stretch with Desktop Operating System June 2018:

https://www.raspberrypi.org/downloads/raspbian/

https://www.raspberrypi.org/blog/raspbi ... june-2018/
Adieu

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 10:00 am

fruitoftheloom wrote:
Fri Jul 20, 2018 9:52 am

PIXEL is no longer the default desktop environment, therefore are you running Raspbian Jessie ?

Raspbian is a fork of Debian ARMHF Operating System.

Raspberry Pi Desktop (replaced PIXEL) is a fork of LXDE.


May I suggest you run the latest release of Raspbian Stretch with Desktop Operating System June 2018:
I think there is a misunderstanding. So, I'm using Raspbian on a Rasbian Pi 3 Model B+. I just downloaded neofetch and this is some of the output:

Code: Select all

 .looooc;;:ol  :oc;;:ooooo'    OS: Raspbian GNU/Linux 9.4 (stretch) armv7l 
   ;oooooo:      ,ooooooc.     Model: Raspberry Pi 3 Model B Plus Rev 1.3 
     .,:;'.       .;:;'.       Kernel: 4.14.52-v7+ 
     .... ..'''''. ....        Uptime: 15 minutes 
   .''.   ..'''''.  ..''.      Packages: 1685 
   ..  .....    .....  ..      Shell: bash 4.4.12 
  .  .'''''''  .''''''.  .     Resolution: 1920x1080 
.'' .''''''''  .'''''''. ''.   DE: LXDE 
'''  '''''''    .''''''  '''   WM: Openbox 
.'    ........... ...    .'.   Terminal: xfce4-terminal 
  ....    ''''''''.   .''.     CPU: ARMv7 rev 4 (v7l) (4) @ 1.4GHz 
  '''''.  ''''''''. .'''''     Memory: 414MB / 927MB 

fruitoftheloom
Posts: 17489
Joined: Tue Mar 25, 2014 12:40 pm

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 10:03 am

pb82 wrote:
Fri Jul 20, 2018 10:00 am
fruitoftheloom wrote:
Fri Jul 20, 2018 9:52 am

PIXEL is no longer the default desktop environment, therefore are you running Raspbian Jessie ?

Raspbian is a fork of Debian ARMHF Operating System.

Raspberry Pi Desktop (replaced PIXEL) is a fork of LXDE.


May I suggest you run the latest release of Raspbian Stretch with Desktop Operating System June 2018:
I think there is a misunderstanding. So, I'm using Raspbian on a Rasbian Pi 3 Model B+. I just downloaded neofetch and this is some of the output:

Code: Select all

 .looooc;;:ol  :oc;;:ooooo'    OS: Raspbian GNU/Linux 9.4 (stretch) armv7l 
   ;oooooo:      ,ooooooc.     Model: Raspberry Pi 3 Model B Plus Rev 1.3 
     .,:;'.       .;:;'.       Kernel: 4.14.52-v7+ 
     .... ..'''''. ....        Uptime: 15 minutes 
   .''.   ..'''''.  ..''.      Packages: 1685 
   ..  .....    .....  ..      Shell: bash 4.4.12 
  .  .'''''''  .''''''.  .     Resolution: 1920x1080 
.'' .''''''''  .'''''''. ''.   DE: LXDE 
'''  '''''''    .''''''  '''   WM: Openbox 
.'    ........... ...    .'.   Terminal: xfce4-terminal 
  ....    ''''''''.   .''.     CPU: ARMv7 rev 4 (v7l) (4) @ 1.4GHz 
  '''''.  ''''''''. .'''''     Memory: 414MB / 927MB 

Yes confusion as you mentioned PIXEL which suggested you were running Raspbian Jessie...

...though you are in fact running Raspbian Stretch.
Adieu

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 10:09 am

fruitoftheloom wrote:
Fri Jul 20, 2018 10:03 am
Yes confusion as you mentioned PIXEL which suggested you were running Raspbian Jessie...

...though you are in fact running Raspbian Stretch.
My bad. I thought PIXEL is just the name Raspbian named its heavily customised LXDE. So, when I'm talking about PIXEL, I refer to the menu entries in the desktop environment. Sorry.

fruitoftheloom
Posts: 17489
Joined: Tue Mar 25, 2014 12:40 pm

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 10:17 am

pb82 wrote:
Fri Jul 20, 2018 10:09 am
fruitoftheloom wrote:
Fri Jul 20, 2018 10:03 am
Yes confusion as you mentioned PIXEL which suggested you were running Raspbian Jessie...

...though you are in fact running Raspbian Stretch.
My bad. I thought PIXEL is just the name Raspbian named its heavily customised LXDE. So, when I'm talking about PIXEL, I refer to the menu entries in the desktop environment. Sorry.

Pixel was retired over a year ago to be replaced by "Raspberry Pi Desktop"
Adieu

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 2:46 pm

Oh, well. I had erroneous information then. Thanks for clarifying.

I tried to solve the problem by playing around with locale, /etc and such and reading on the internets to no avail. It's stubbornly set to Swiss German.

So, I thought I'll just reinstall Raspbian and set locale to GB and change keyboard layout to German. Menu is now in English

Using the LXDE Applet doesn't work. After reboot, it changes back to American!

I changed the Keyboard Layout to German in the Raspberry Pi Configuration. It seem to work now, but an odd thing is that the LXDE Applet shows the American flag still even though the Layout is German.

So, if it stays this way and the German Layout doesn't get lost, it is okay, but I am a bit annoyed that the LXDE applet won't work correctly, making switching keyboards a hassle, but as long as I keep using my German Keyboard it is at least working, but I am a bit underwhelmed.

Why isnt there just a text file where I can set the language environment for good? Would seem like a logical Unix way to set it if GUI apps and such don't work as intended. But, as I said, trying to set this with locale and such didn't work. It seems it is an upstream issue, though, as i have seen many people on the internets struggling with similar problems.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20512
Joined: Sat Jul 30, 2011 7:41 pm

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 3:09 pm

I'll flag this up to SPL who works on this stuff, but ISTR him saying that the localisation support in Linux is a bit pants, so this may be a limitation in there rather than the GUI stuff he works on.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 3:27 pm

Thank you. I appreciate that.

On a side note, I also want to say that Raspbian looks great. It is the most beautiful implementation of LXDE I have seen yet.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 291
Joined: Fri Dec 26, 2014 11:02 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 3:51 pm

For someone in your position, the new startup wizard will not do what you want, as you have already discovered. This is intentional - the aim of the wizard is to make setting up as easy as possible for the 95% of users who do not need a custom locale/keyboard setting. If I were to make it able to cope with special cases like yours, there would be very little point in having it, as it would then just be a duplicate of the Raspberry Pi Configuration tool...

However, the Localisation tab of the Raspberry Pi Configuration GUI utility (not the command-line raspi-config tool) should be able to do what you need. There are independent selectors in there for locale (which you should set to English / GB), for keyboard (which you should set to German) and for timezone (which you should set to Europe / Zurich). That should set the relevant Linux settings, and all of those work for me.

I've not used the LXDE keyboard switcher applet; many parts of LXDE, particularly those concerned with localisation, really don't work properly, and it sounds as if that may be one of them. At some point I may get around to fixing it, but the number of people who want to switch between multiple keyboards is pretty small, so it is a low priority. It may well be that the keyboard switcher is actually causing your problem, so I'd recommend removing it from the panel and relying on Raspberry Pi Configuration.

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 4:34 pm

Thanks for clarifying.

In the end, that's exactly what I did and discovered: raspi-config did not what I wanted, the GUI Configuration Tool works (though I'm not sure if changing the Locale worked and now that my system works, I don't dare touch it), the LXDE Applet, though, doesn't. So I ditched the Applet. The only thing I miss now is a layout switcher, so basically what the Applet would have provided.

Raspbian is really great, but it might be a bit too much on rails for my needs. I might consider trying a different setup for my use case when I have more free time. Also, I might try out if Openbox can provide an easy way to switch.

Thanks a lot! :)

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 291
Joined: Fri Dec 26, 2014 11:02 am

Re: Suggestion: Languages, Keyboard layouts

Fri Jul 20, 2018 6:55 pm

pb82 wrote:
Fri Jul 20, 2018 4:34 pm
...though I'm not sure if changing the Locale worked and now that my system works, I don't dare touch it...
If your menu is all in English and not half-English, half-German, then the locale is set to English.

barts2108
Posts: 1
Joined: Thu Sep 13, 2018 6:13 pm

Re: Suggestion: Languages, Keyboard layouts

Thu Sep 13, 2018 6:17 pm

I have the same problem.

I am want Dutch regional settings, English UK language and US international keyboard.
However in the config when I choose for Dutch, no way that I can select English UK language.

Any other way to get this done ?

pb82
Posts: 8
Joined: Fri Jul 20, 2018 8:05 am

Re: Suggestion: Languages, Keyboard layouts

Fri Sep 28, 2018 4:23 pm

So, I found a workable solution.

First I tried just downloading fbxkb, a keyboard switcher I use on my MX Linux machine. After I launch it, it shows up in the Panel, but when I click on it, it doesn't open the menu to choose the keyboard layout. But at least, the applet in the panel shows reliably the flag of the current keyboard layout. So it might prove useful.

Code: Select all

sudo apt install fbxkb
Then, I tried using setxkbmap on the cli.

It works. But beware that using it wrong might make it unrecoverable if you type in the wrong keyboard code and make it impossible to switch back.

This is how it works:

Type

Code: Select all

setxkbmap (your country code)
for example

Code: Select all

setxkbmap nl
Changes to dutch.

Code: Select all

setxkbmap ch
Changes to swiss German.

Code: Select all

setxkbmap gb 
Changes to Britain.

Before you do anything else, type

Code: Select all

setxkbmap us
This will change to US layout.

This step will ensure you can revert to that layout, if you mistype to another layout that makes it unrecoverable for you, e.g. by switching to a language that doesn't use the latin alphabet. If that happens, hit the up arrow key repeatedly until you get back to this command in your bash history.

Now that you know the command to switch your layout, set a keyboard shortcut for it. To that effect, open this file:

Code: Select all

~/.config/openbox/lxde-pi-rc.xml
Search for the section about keybindings and add the following ones, by changing the details according to your layout preferences:

Code: Select all

    <!--keybindings to change keyboard layout -->
    <keybind key="A-F9">
      <action name="Execute">
        <command>setxkbmap de</command>
      </action>
    </keybind>
    <keybind key="A-F10">
      <action name="Execute">
        <command>setxkbmap ch</command>
      </action>
    </keybind>
In this example, pressing Alt+F9 or F10 will change the keyboard layout to German or Swiss German.

To have a visual feedback on what layout is currently active, run fbxkb. You can have it run automatically by adding it to

Code: Select all

~/.config/lxsession/LXDE-pi/autostart
This is the line to add:

Code: Select all

@fbxkb
Now you should see the flag in the panel at log in and be able to change layout with the keybindings you set.

Return to “Raspbian”

Who is online

Users browsing this forum: Google [Bot] and 26 guests