locale problem #2

  • Follow


I've just installed solaris 9. Instyead of the default US-7 ASCII locale
(C/Posix) I've opted to install the french canadian and english canadian
locale as well.

When web start asked me for the default system local, I responded POSIX.

I was hoping that afterward, I could simply put:

LANG=fr_CA.ISO8859-1
export LANG

And get dates in french and error message in french for my regular user's
ssh sessions, and have the english messages by default.

That does not seem to work. I get correct dates, sort, etc... in french, but
the error messages are still in english. I then proceeded to load the
"languages CD" and run the web start installer and install the french locale
and rebooted. That did not help either...

Is there a way to accomplish what I want ? I still need the english messages
for root, because it's easier to search the doc in english when you encouter
a problem (not to mention that the french messages confuses me at best)

Thanks


0
Reply G 5/26/2005 6:31:43 PM

G Dahler wrote:
> I've just installed solaris 9. Instyead of the default US-7 ASCII locale
> (C/Posix) I've opted to install the french canadian and english canadian
> locale as well.
> 
> When web start asked me for the default system local, I responded POSIX.
> 
> I was hoping that afterward, I could simply put:
> 
> LANG=fr_CA.ISO8859-1
> export LANG
> 
> And get dates in french and error message in french for my regular user's
> ssh sessions, and have the english messages by default.
> 
> That does not seem to work. I get correct dates, sort, etc... in french, but
> the error messages are still in english. I then proceeded to load the
> "languages CD" and run the web start installer and install the french locale
> and rebooted. That did not help either...
> 
> Is there a way to accomplish what I want ? I still need the english messages
> for root, because it's easier to search the doc in english when you encouter
> a problem (not to mention that the french messages confuses me at best)

I've never played much with those, but a quick test seems to show that LANG is
not the variable to set, and that there might be a minor ssh inconsistency here.

Look at those tries:

Everything C, everything in English.
$ locale
LANG=C
LC_CTYPE=C
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=C
LC_ALL=

$ ssh localhost
Password:
Password:
Password:
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

LC_MESSAGES fr_FR.UTF-8, everything else C: first messages in English, last in
French:
$ locale
LANG=C
LC_CTYPE=C
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=fr_FR.UTF-8
LC_ALL=

$ ssh localhost
Password:
Password:
Password:
Permission refus�e (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

LC_MESSAGES abd LC_CTYPE in fr_FR.UTF-8, everything else in C, messages all in
French:
$ locale
LANG=C
LC_CTYPE=fr_FR.UTF-8
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=fr_FR.UTF-8
LC_ALL=

$ ssh localhost
Mot de passe :
Mot de passe :
Mot de passe :
Permission refus�e (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

So to get ssh in French, you need to set at least LC_CTYPE and LC_MESSAGES. LANG
appears to be irrelevant here. But you'd probably be better just setting LC_ALL
and LANG.

HTH,

Laurent
0
Reply Laurent 5/26/2005 9:19:04 PM


"Laurent Blume" <laurent=//=pas_de_pub/news200505@elanor.org> a �crit dans
le message de news:42963d53$0$1723$79c14f64@nan-newsreader-05.noos.net...
>
> I've never played much with those, but a quick test seems to show that
LANG is
> not the variable to set, and that there might be a minor ssh inconsistency
here.
>

After setting LANG=fr_CA.ISO8859-1 and EXPORTING lang, I get all variables
set to fr_CA.ISO8859-1, and
it does not work...

Strange....


0
Reply G 5/26/2005 10:12:19 PM

Laurent Blume wrote:

> LC_MESSAGES fr_FR.UTF-8, everything else C:
> first messages in English, last in French:

> LC_MESSAGES and LC_CTYPE in fr_FR.UTF-8, everything else in C,
> messages all in French

Possible reason: To properly use 8bit messages (LC_MESSAGES),
you should allow it to print 8bit characters (LC_CTYPE), too?

> LANG appears to be irrelevant here.

If LANG is set, it controls those categories which haven't been set
explicitly (useful for localizing a complete user environment,
hence the name).  You only should set other categories by very
intention then: For example if you want to avoid "unexpected"
sort orders, additionally set LC_COLLATE=C.

However, you have explicitly set all variables, not just LANG.

> $ locale
> LANG=C
> LC_CTYPE=C
> LC_NUMERIC=C
> LC_TIME=C
> LC_COLLATE=C
> LC_MONETARY=C
> LC_MESSAGES=C
> LC_ALL=

because locale(1) indicates indirect influence by using doublequotes:

$ LANG=fr_CA.ISO8859-1 LC_COLLATE=C locale
LANG=fr_CA.ISO8859-1
LC_CTYPE="fr_CA.ISO8859-1"
LC_NUMERIC="fr_CA.ISO8859-1"
LC_TIME="fr_CA.ISO8859-1"
LC_COLLATE=C
LC_MONETARY="fr_CA.ISO8859-1"
LC_MESSAGES="fr_CA.ISO8859-1"
LC_ALL=


> But you'd probably be better just setting LC_ALL and LANG.

LC_ALL is only useful for debugging or quick workarounds,
it's overriding all other variables.
0
Reply Sven 5/27/2005 8:53:49 AM

Laurent Blume <laurent=//=pas_de_pub/news200505@elanor.org> wrote:
> Look at those tries:
[...]

Had the same problems. Seems to me like a bug in the locale negotiation.
I just set on the client host (which issues the ssh command) the environment
variable SSH_LANGS to an empty string. Now sshd initializes the LC_*
environment from /etc/default/init.

On the source machine I had set:

LC_MESSAGES=de
LC_NUMERIC=C
LC_*=de_DE.ISO_8859-1

LC_ALL and LANG were unset.

IMHO ssh and sshd should at most only set the LC_* variables which were
set at the source host, not LANG and even less LC_ALL - which overrides
any other locale settings anyway.
And it shouldn't set them to a *.UTF-8 locale, while all variables on
the source host suggest a ISO_8859-1 or POSIX locale.

This (mis)feature of Sun's ssh is quite annoying.

-- 
Daniel
0
Reply Daniel 5/27/2005 5:18:31 PM

G Dahler wrote:
> After setting LANG=fr_CA.ISO8859-1 and EXPORTING lang, I get all variables
> set to fr_CA.ISO8859-1, and
> it does not work...

I should have tried that. It seems to be a bug in the fr_CA localization data of
ssh.

$ export LC_ALL=fr_CA.ISO8859-1

$ ssh localhost
Password:
Password:
Password:
Permission refus�e (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

$ export LC_ALL=fr_FR.ISO8859-1

$ ssh localhost
Mot de passe :
Mot de passe :
Mot de passe :
Permission refus�e (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

There are many localization problems with Solaris 10. Too many new features, not
enough translators, it seems.

Laurent
0
Reply Laurent 5/27/2005 6:48:34 PM

Sven Mascheck wrote:
> Possible reason: To properly use 8bit messages (LC_MESSAGES),
> you should allow it to print 8bit characters (LC_CTYPE), too?

No, because it displays a 8 bit char (�refus�e�), even with LC_CTYPE set to C.

> If LANG is set, it controls those categories which haven't been set
> explicitly (useful for localizing a complete user environment,
> hence the name).  You only should set other categories by very
> intention then: For example if you want to avoid "unexpected"
> sort orders, additionally set LC_COLLATE=C.

Ah, I see, I should read more manuals :-)

> However, you have explicitly set all variables, not just LANG.

They're set by the system, except LC_ALL, which is unset by default.

> LC_ALL is only useful for debugging or quick workarounds,
> it's overriding all other variables.

You're right, of course.

Laurent
0
Reply Laurent 5/27/2005 6:52:34 PM

I've managed to get my frnech locale setup, get french error messages,
etc...

But in my login shell, I still have english message (I mean, when I ssh in
the box, the /bin/sh I'm handed is using the system default which is
Posix/C)

So the shell error messages (e.g: "not found") are in english. If I set the
LANG or LC_MESSAGES and LC_CTYPE in my .profile, it does not work either,
the shell is already started at this time.

So, apart from running a seconds shell (which is a waste) I don't see how I
can get a "french" shell.

I presume that using a window manager and starting an xterm woule be in
french, but in our case, we have to login in text mode through ssh.

I still want people to use the language they want.

Thanks


0
Reply G 5/27/2005 8:57:03 PM

"G Dahler"  wrote:

> I've managed to get my frnech locale setup, get french error messages,
> etc...
> 
> But in my login shell, I still have english message (I mean, when I ssh in
> the box, the /bin/sh I'm handed is using the system default which is
> Posix/C)

If it is enabled, would setting the LC_* variables in ~/.ssh/environment
help? Or is it already too late?
0
Reply Marc 5/27/2005 9:39:35 PM

8 Replies
256 Views

(page loaded in 0.116 seconds)

Similiar Articles:













7/23/2012 4:40:01 PM


Reply: