[SOLVED] How do I change languages in Mint? (while using OpenOffice mainly)
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Thanks, MTK358. I must say, I like KDE better, but my computer does not function as well with it as with Gnome (it's a really old one), so I 'll keep it for when needed.
Thank you also, craigevil. I have the language packages for OpenOffice with their dictionaries and fonts (plus a whole lot more fonts, as I am a font-maniac!).
I couldn't find "system>administration>language support", so I went to language support from the control panel, but I could not find a way to define a shortcut-key. I must say that I am not interested in changing the language that Gnome names files and its functions, utilities, etc., but rather I want to change languages in text (txt, doc, rtf, odt, etc.) while writing. This means I need to change keyboard layouts, but I want them organised by language.
I also couldn't find Utilities in the "Add to Panel" menu...
Do you maybe know the commands for all this?
I just fell in love with the terminal!!! With the command setxkbmap -layout <xx> I was finally able to bypass the limitation of four layouts set by GNOME! Thank you very much, MTK358!
One bit of advice to any who read this and will want to use non-latin layouts: before typing the command setxkbmap -layout ru (I'm using Russian as an example), make sure to type first the command for a latin layout (e.g. setxkbmap -layout fr) and then to switch to the non-latin layout, so that when you will want to switch back to your original layout you will be able to copy-paste the command for the latin layout you typed earlier and then type the command for the layout you want. If you don't do this you won't be able to give any command in the terminal, as it needs commands in latin characters! The only backdraw of this is that you have to memorise the two or three letter code for the languages you want (I'm still trying to figure out the code for Frysian)...
I wonder why GNOME decided to do such a stupid thing...
It might be possible to remove that limitation, but that would require getting GNOME's source, modifying it, compiling it, and after all that trouble end up GNOME not being managed by ther package manager.
I wonder very much too, I hope in the future this will be fixed...
I must say, I encountered the same limitation using KDE and Xfce. Assuming that it was because although I installed the respective packages the version of Mint remained Gnome (the introductory panel in KDE or Xfce session still stated Linux Mint Gnome), I have started to try out various Linux distros in VirtualBox. Until now I encounter still the same limitation! Is it possible that VirtualBox is influenced by my distro and so sets this limitation? It hardly seems possible. But the only other explanation I have is that besides Gnome also KDE and Xfce have this limitation (which I also find rather unbelievable). I am severely tempted to reformat my drive and install some other distro to see what will happen...
That can only mean the KDE and Xfce have the same limitation! This is really getting very annoying. I will also check LXDE and Fluxbox out, hoping they will have escaped the menace of the four-language-limit. Do you know if there are distros which use their own desktop version and not one of the above?
It's kind of strange that other desktops would have the same limitation, but who knows. Also, there is no distro with its own custom DE. Maybe it's because they think clicking on the icon to cycle throught more than 4 layouts is a bad idea.
But that gave me an idea: why not write your own layout switcher app? I don't think it would be too difficult to write a small Qt GUI app that has an icon, and would execute the setxkbmap command behind the scenes to actually switch the layout. I just wonder is it would somehow interfere with the DE's layout switcher.
I made a little example Python script that has a combo box that lets you choose the layout. Try it by putting it in a text file, giving it executable permissions, and running it. Make sure you have PyQt4 installed (the Mint package "pyqt4-dev-tools").
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app = QApplication(sys.argv)
combo = QComboBox()
# the first string is the text visible in the combo box, the second is the code passed to "setxkbmap -layout".
combo.addItem('US English', 'us')
layout = str(combo.itemData(index).toString())
command = 'setxkbmap -layout %s' % (layout)
# uncomment the following line and change the path to your xmodmap file if you use one
# QProcess.startDetached("xmodmap /home/username/.Xmodmap")
QObject.connect(combo, SIGNAL('activated(int)'), layoutSelected)
Great idea!!! Thank you, MTK358!!! I will get to it right away (of course, as I am inexperienced in app-writing, it will take me some time). When I have made something satisfactory I will upload it and tell you about it...
By the way, I tried LXDE, but it is even worse than the rest. The only way to change layouts is with the setxkbmap-command...
Note that Qt is actually a C++ toolkit and PyQt4 is just a set of bindings, but Python is a far easier language for beginners. Also there's the GTK+ toolkit, but I think that Qt is much easier to work with and has friendlier documentation.
Thank you very much, MTK358. I will get right to it...
By the way, I tried your example Python script, it works beautifully! (of course, you temporarily lose the layouts you have set through the DE's layout switcher, until reboot)
I just wanted to point out a flaw in my example app:
I used QProcess.startDetached(), which doesn't wait for the clild process to exit before continuing, and that might interfere with the fact that another process wll simultaneously be started if you use the xmodmap and that might have unpredictable results.
You should probably use Python's os.system() (be sure to import os first), which waits for the child process to exit before returning, instead of PyQt4's QtCore.QProcess.startDetached().