Multilingual support for ssh sessions
Hello,
I am looking for some help setting up my slack-current system to support more than one language when ssh'ing into a machine on my network that has a language other than English as its default language. I live in a multilingual family. The two primary languages are English and German. My main machine is set up to use English as its default language. I have recently built a machine from parts and installed kubuntu on it with German as the default language. It has a German keyboard attached to it. I occasionally ssh into the kubuntu machine to perform administrative tasks and, well, because I can. Since it uses German as its primary language, however, in the terminal on my slack box the German special characters appear, uh, not quite right. How can I adjust my main slack-current box such that the German characters appear as they should in the aterm terminal window when I ssh in? I suspect it has something to do with getting both boxes to use the same character set - such as UTF - but I don't know how to do that. Can someone point me to a resource where I can get some information on how to do this? |
|
Instead of changing the locale to de_DE, de_CH, or similar, wouldn't be easier to have him just change his character set for his terminal to ISO-8859-1 (or -15, which has the euro)? It supports all of the western-European languages (and as a result, English also).
hussar: I think you could get away with just modifying /etc/profile.d/lang.[c]sh, which has comments in it also. Unfortunately I don't have aterm on my box to test this with. Hope it helps :) |
I looked at the possibility of changing my main box's language to DE, but it doesn't really make sense to do that since it has an American English keyboard attached. I would probably end up with some problems due to language setting and keymap mismatch. (Having an US English keyborad isn't a problem when using the CLI over ssh, because none of the commands I need - ls, rm, cp, etc. - uses any special characters. The main problem is reading some of the system messages that get sent back.)
Daga, while I was researching this last night, I looked at the /etc/profile.d/lang.[c]sh files, and changed from C and en_US to 8859-15 (Latin9, or 8859-1 with the Euro symbol and some others). I tried changing the settings by issuing the command `. /etc/profile.d/lang.csh` but I got the error message that setenv was not found. It was kind of late though, and rather than fooling with it, I went to bed. I'm going to give it another shot this evening. |
Having worked with this quite a bit (it´s a pet obsession of mine), I strongly recommend not going with any of the 8859 sets any more. UTF-8 is the way to go, and I suspect, given the aggressively multinational nature of the Ubuntu family, your kubuntu box is already defaulting to UTF-8. This is probably why you are seeing bad characters: Kubuntu is sending UTF-8 encoding, and you are reading ISO8859-1. For the remainder of this post, I am assuming you are switching your slackware box to UTF-8 and not the kubuntu box to iso8859-*, both because I believe this is the RightThing(TM) for i18n and because I don´t know where kubuntu stores its encoding declarations. I should warn you, though, that to the best of my knowledge aterm is not yet Unicode-savvy. You will probably have to use a different terminal program, which I will come to later.
First, /etc/profile.d/lang.[c]sh should be updated: lang.sh: export LANG=de_DE.UTF-8 lang.csh: setenv LANG de_DE.UTF-8 replacing de_DE with whatever is appropriate. en_US should work as a fallback, as it will still allow display and input of the full range of non-US characters. If I understand your post correctly, your slackware box has an English keyboard installed. For that, I editted /etc/X11/xorg.conf to include: Option "XkbLayout" "en_US.UTF-8" although you might also try (this latter should work even if you decide to stick with iso8859-* encodings): Option "XkbLayout" "us" Option "XkbVariant" "alt-intl" Option "XkbOptions" "compose:rwin" Thanks to the xorg list, I recently found out that you will need to edit /etc/profile.d/gtk+2.[c]sh export GTK_IM_MODULE=xim and /etc/profile.d/qt.[c]sh as well: export QT_IM_MODULE=xim This will give you access to the full range of compose sequences in /usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose If you´ve chosen to stay with iso8859-1 or -15, then replace en_US.UTF-8 with the ISO encoding in that filename. If it´s in that file, you can type it on the keyboard and that file will tell you how. (By the XkbOptions directive above, "Multi-key" in the Compose file is the right Windows key on the keyboard.) You will need Unicode fonts. You can get classic X bitmap fonts at Markus Kuhn´s Unicode Fonts and Tools page. Personally, I prefer to use TrueType/OpenType fonts. Search for FontPath in /etc/X11/xorg.conf and add the following line: FontPath "/usr/X11R6/lib/X11/fonts/TTF/" if it´s not already there, and dump truetype unicode fonts there. Personally, I like the Gentium family. If you choose to do so (though it violates Microsoft´s license) you can add their core fonts for the web (Verdana, Georgia, Tahoma, Arial, etc.). Many, many more unicode fonts are available at http://www.slovo.info/unifonts.htm and http://www.alanwood.net/unicode/fonts.html. Don´t forget, as I did, to tell your terminal program to use the new fonts. Speaking of the terminal program, aterm is not, to the best of my knowledge Unicode-compliant. You will have to switch: rxvt-unicode, mlterm, Terminal (from os-cillation.com), and gnome-terminal are all compliant, I believe. Further resources: http://melkor.dnp.fmph.uniba.sk/~gar...WTO/howto.html http://eyegene.ophthy.med.umich.edu/unicode/ http://www.jw-stumpel.nl/stestu.html You may want to go further with converting filenames and text data on native linux filesystems, or on network mounted filesystems. I have not found this necessary, but if you choose to do so see http://hektor.umcs.lublin.pl/~mikosm...x-unicode.html Hope this is helpful, and good luck. |
quiescere, I am now getting umlauts and German-style quotes in a gnome terminal window, but since I didn´t try it before, I don´t know it that is new or not. I am not getting the special characters in aterm (which you predicted) or rxvt (which according to rxvt -help has multilanguage support compiled in). I have also noticed that if I want to type an apostrophe or double-quote character, I need to hit the key twice.
I need to play with this some more to see what has really changed. BTW, in the files *.csh ¨export¨ needs to be ¨setenv¨. It does not appear that csh understands ´export´. Thanks for your help. |
Quote:
Option "XkbVariant" "nodeadkeys" With deadkeys, you easily type characters with accents, umlauts, etc. by first typing the accent, then hitting the relevant character. Hitting double-quote then hitting a gives an a with an umlaut, for example. To get a double-quote by itself, hit the double-quote key then hit the spacebar. Quote:
|
Now that I know what it is, I think it is great! Any idea why I would be getting different results for the key combination double-quote-u and double-quote-o in this firefox editing window than I do in xterm?
I looked through the Compose document, but couldn't find the German double s. Do you happen to know what that combination is? I also need to figure out which of my keys is the Multi_key. I've tried both Windows keys and both Alt keys, and they give different results. But, hey, this is great! I didn't realize that getting the terminal sessions to look better would have this great side-effect. |
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
I thought I would use showkey to figure out what the key numbers were, but I have just discovered that showkey doesn't want to work in a terminal window while X is running and that the numbers are different when I am in a non-X console or an X terminal window. I tried xev as you suggested though, and it works pretty well. My right Windows key is 116; the left is 115. |
All times are GMT -5. The time now is 05:37 PM. |