Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kinput and kterm SOLVED!!!!!



Martin Baehr <mbaehr@example.com> writes:

> well, yes, but in my situation i never want to change the locale,
> just the input method. i would also like to input german
> without using a german locale. why? because i prefer original text
> over translations. therefore in general i see a need to seperate input 
> from output as far as the locale goes.

For choosing the language of the messages you want the programs to
output there are LC_MESSAGES and LANGUAGE. I.e.

    LC_MESSAGES=en_US

will give you English messages. You can also set

    LANGUAGE=en_US

this will give you english messages as well. LANGUAGE overrides
LC_MESSAGES. LANGUAGE is a GNU extension and therefore only available
on GNU systems. Contrary to all the other locale specific environment
variables, LANGUAGE can be set to a colon separated list of locale
names, for example:

    LANGUAGE=en_US:de_DE

this means: "give me US-English messages first if available, if not
try German".

The relevant variable for XIM is only LC_CTYPE. You can see that for
example, if you start 'gedit' like this:

    ~$ LANGUAGE=en_US LC_MESSAGES=en_US LANG=en_US LC_CTYPE=ja_JP gedit

you will then get English menus in gedit but Japanese input still
works because of LC_CTYPE (even though LANG is set to
en_US!). LC_MESSAGES in this command line is meaningless because it is
overridden by LANGUAGE.

> to assume that, because i want to input a language, also means,
> that i want to read that language is wrong and shortsighted imho.

For most applications you can achieve your desired behaviour
by setting LC_MESSAGES or LANGUAGE.

> > But then kterm will also load Japanese app-defaults,
> > as it should be. To get English menus, you have to use English
> > app-defaults for kterm (preferably in your home directory). 
> 
> but i do not manually want to change every application
> to override a locale setting.

For most applications, setting LC_MESSAGES or LANGUAGE is enough
to select the language for the messages the program outputs.

Only the programs using X11 app-defaults for their menus behave
differently. But there are only very few such applications anyway.
On my current system, only Netscape and kterm have Japanese
app-defaults. I have a few more programs with Korean app-defaults:

    mfabian@example.com:~$ ls /usr/X11R6/lib/X11/ko/app-defaults/
    Editres        Fig      Rxvt        XConsole  XTerm-color  Xmag  Xmessage
    Editres-color  Hanterm  XClipboard  XTerm     Xedit        Xman
    mfabian@example.com:~$ 

I checked again and currently the behaviour of these programs using
app-defaults is quite inconsistent:

    netscape: uses LANG to decide which app-defaults to load,
              i.e. "LANG=en_US LC_CTYPE=ja_JP netscape" will
              show English menus but Japanese input is enabled.

    kterm:  uses LC_CTYPE to decide which app-defaults to load, i.e
            you cannot choose the app-defaults to load separately
            from XIM. 

    xterm, hanterm, rxvt, xclipboard:   same as kterm

    xmag, editres: same as netscape

I don't know what the 'correct' behaviour should be. Where is this
specified? The behaviour of Netscape, xmag, editres appears more
useful, although using LANG instead of LC_MESSAGES to decide the
language of the menu is still weird in my opinion.

But apart from this handful of programs which have non-English
app-defaults (If you don't do Korean only kterm and Netscape remain)
you can choose the input language with LC_CTYPE and the language of
the messages with LC_MESSAGES or LANGUAGE.

-- 
Mike Fabian   <mfabian@example.com>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links