How do I switch keyboard languages in 10 Lxde?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
tomi87
Level 1
Level 1
Posts: 4
Joined: Mon Jul 04, 2011 9:21 am
Location: Romania

How do I switch keyboard languages in 10 Lxde?

Post by tomi87 »

Hello. I'm completely new to Linux, sorry if there's anything wrong with the question. I did try to search but failed to find a solution.
After an attempt with Xubuntu 10.10 which didn't detect my HDD, I managed to install Linux Mint 10 LXDE on my laptop (Acer TravelMate5310, Celeron M 1,6, 1GB RAM), everything works fine, but I don't seem to manage to switch between keyboard languages the way you would do it with Alt+Shift in Windows (or in any other way in fact). I really need to be able to switch quickly when I'm doing translations, and this is the only problem that is preventig me from moving from Vista to Mint with everything I use the computer for, but I'm sure there is a solution.

I've made the 'Keyboard Layout Switcher' show in the panel. First it showed Latin when I selected US from the menu, after a new boot it shows US, but won't let me switch to anything else, even though I installed the languages I need (only the spellchecking and writing aids part, not the translations. Could this be the problem? But as far as I can tell, input methods are installed by default).

As a worst case scenario I could even imagine switching layouts from the menu every time, but I can't even find Hungarian there, despite having installed the language. (I need to use standard US English (qwerty), Italian, Hungarian and Romanian keyboards).

What am I doing wrong?

Thank you.
Gee7
Level 1
Level 1
Posts: 32
Joined: Tue Mar 31, 2009 7:07 am

Re: How do I switch keyboard languages in 10 Lxde?

Post by Gee7 »

Hello tomi87

I haven't used Lxde Mint but maybe there are 2 things to look at here. In Linux, for security reasons, you often have to enable things before they work, sometimes as root. It's possible that (1) you need to select languages in Keyboard Settings and (2) that you have to enable the languages that are installed and available once enabled. If you make changes in either of these areas and they don't work, you can easily reverse the changes you made.

For keyboard settings, you can probably select your languages by going to Control Centre/Keyboard/layouts and clicking Add. Find your country and language and add it here. You can add several keyboard language layouts here. If Mint Lxde doesn't have Control Centre or Keyboard/layouts, you can probably find similar settings in the Menu.

The keyboard settings as given above may not be necessary in your case, but it is worth a try.

Next we come to the fact that you installed languages but they are not enabled. So we have to enable them. You will need to open a terminal and get administrator privileges by typing "sudo" followed by your command. You need to edit the language list and the command depends upon the name of your text editor. My text editor is called Gedit (because I use the Gnome Editor) and the command is "gedit". To edit the language list in Linux Mint Debian I type:

$ sudo gedit /etc/locale.gen

and the list of languages appears.

In Linux Mint 11 Gnome, you have to add the languages to a different file, and the file is opened with the command:

$ gksu gedit /var/lib/locales/supported.d/local

I am not sure which command will be best for Mint Lxde as I have never used it and have no access to it. However, one of them should work. In this list of languages you should see the following:

For English

en_US.UTF-8 UTF-8
# en_GB.UTF-8 UTF-8

For Italian

# it_CH ISO-8859-1
# it_CH.UTF-8 UTF-8
# it_IT ISO-8859-1
# it_IT.UTF-8 UTF-8
# it_IT@euro ISO-8859-15

For Hungarian (I guess this means Hungarian)

# hu_HU ISO-8859-2
# hu_HU.UTF-8 UTF-8

and the following may or may not be for Romanian - you will have to check on that and the Hungarian:

# ro_RO ISO-8859-2
# ro_RO.UTF-8 UTF-8

So, to enable your selected languages, remove the # (hash sign) from in front of them and Save the file.

As there are choices, especially in Italian, you should try the most common only first; select only these and try:

en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
it_IT.UTF-8 UTF-8
hu_HU.UTF-8 UTF-8
ro_RO.UTF-8 UTF-8

I added British English just so that you can remember it is the papa of the English language, and used in many parts of the world. Its addition can only be of benefit :)

The # in front of the languages means "What follows is only for information ...". By removing the # we make the languages active. Remember to check that these are the correct languages for Hungarian and Romanian.

If you edited the /var/lib/locales/supported.d file by adding the above languages, you need to finish the process by typing in the terminal:

$ gksu dpkg-reconfigure locales

and then rebooting.

If you edited the /etc/locale.gen file instead, you need to finish the process by typing in the terminal:

$ locale-gen

and then rebooting.

If enabling the languages works but, for example, Italian does not have enough support-, you can always add another of the Italian language files as shown above.

I hope this may be useful. Make a note of any changes you make and revert back to your original settings if necessary.

Sok szerencsét kivánok!
AlbertP
Level 16
Level 16
Posts: 6712
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: How do I switch keyboard languages in 10 Lxde?

Post by AlbertP »

This are languages of the user interface, and not keyboard layouts.

For keyboard layouts, Mint 11 LXDE will have a program. Mint 10 LXDE doesn't yet have an easy program for setting up the layout.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
tomi87
Level 1
Level 1
Posts: 4
Joined: Mon Jul 04, 2011 9:21 am
Location: Romania

Re: How do I switch keyboard languages in 10 Lxde?

Post by tomi87 »

@AlbertP
It has something called Keyboard Layout Switcher, which I put on the panel, but won't switch anything, it only displays the language set from the menu.
I also installed IBus, but got nowhere with it.

@Gee7
Thanks a lot, this is what I'll have to do in order to get the missing language on the list (strangely it put Hu in a separate text file.
I found the file (/var/lib/locales/supported.d/local).
In the command you mentioned I replaced gedit with leafpad, it seems to have worked. With the finishing command nothing visible happened, we'll see how it works after reboot. :)

Later edit: the changes to the file have been saved but 'hu' is still missing from the keyboard list (after reboot) :(
Even later edit :) : it seems that Albert was right, that does not change the keyboard languages but rather something else.
tomi87
Level 1
Level 1
Posts: 4
Joined: Mon Jul 04, 2011 9:21 am
Location: Romania

Re: How do I switch keyboard languages in 10 Lxde?

Post by tomi87 »

I found a temporary solution (with valuable help from local forums). It's far from the ideal, as it is quite slow and requires attention, but it works: various keyboard layouts can be activated by running one of the following lines:

Code: Select all

setxkbmap ro std
setxkbmap hu
setxkbmap us
setxkbmap it
and so on for other languages.
Gee7
Level 1
Level 1
Posts: 32
Joined: Tue Mar 31, 2009 7:07 am

Re: How do I switch keyboard languages in 10 Lxde?

Post by Gee7 »

Sorry I couldn't be of help. I posted on the off chance because at the time no other users had posted suggestions.

By the way, did you try using Control+Space to switch keyboards? It had slipped my mind when I posted before. Using Ctrl+Space works with other Linux Mint editions when switching to Asian language keyboards - you have to open an Office document or Text editor first.
conslie
Level 4
Level 4
Posts: 366
Joined: Sun Oct 11, 2009 2:03 am

Re: How do I switch keyboard languages in 10 Lxde?

Post by conslie »

Unless you are determined to use LXDE you might want to try the standard Ubuntu-based Gnome editions. The procedure for adding and switching between keyboard layouts is quite well developed and easy to use --> Preferences/Keyboard.
Post Reply

Return to “Newbie Questions”