Index: [Article Count Order] [Thread]

Date:  Fri, 2 Nov 2007 01:52:42 +0200
From:  Michael Stauber <bq (at mark) solarspeed.net>
Subject:  [coba-e:11056] Re: Translate in French (Howto: translations)
To:  coba-e (at mark) bluequartz.org
Message-Id:  <200711020052.43190.bq (at mark) solarspeed.net>
In-Reply-To:  <472A1504.9070209 (at mark) wapspirit.ch>
References:  <47275EB3.5040209 (at mark) wapspirit.ch> <200710302051.33333.bq (at mark) solarspeed.net> <472A1504.9070209 (at mark) wapspirit.ch>
X-Mail-Count: 11056

Hi Pascal,

> This day, I have try your howto on a test system, but something is strange.
>
> I have copy all files from the folder
> "/usr/share/locale/en/LC_MESSAGES/" to
> "/usr/share/locale/fr/LC_MESSAGES/" directly without translate.
>
> After I have put the fr in the cce. (like your howto)
>
> When I select the French language in the user interface, i see only the
> var like : tcpIpSettings or dnsAddressesField  and not the real text.
>
> I suppose that we need to setup something more like fr =
> /usr/share/locale/fr/LC_MESSAGES/ but i don't now where.

Ah, yes. I noticed that myself last night when I tried to play around with the 
German translation.

It's a little complex unfortunately and I haven't yet fully figured it out. A 
couple of things happen here:

When you change the language for "admin" in the GUI, /etc/sysconfig/i18n gets 
rewritten to default to the language you choose for Admin. 

Usually on an English BlueQuartz is like this:

[root@cbq tmp]# cat /etc/sysconfig/i18n
LANG=en_US
LC_ALL=en_US
LINGUAS="en ja"

If I set it to German through the GUI, it changes this to:

[root@cbq tmp]# cat /etc/sysconfig/i18n
LANG=de_DE@euro
LC_ALL=de_DE@euro
LINGUAS="de en ja"

This changes the systems locale as well (check it with the "locale" command).

When the Apache for the AdmServ is restarted, the start/strop 
script /etc/init.d/admserv takes changed LANG, LC_ALL and LINGUAS into 
account:

start() {
        echo -n "Starting admin web server: "
        export LANG LC_ALL LINGUAS
        export PHPRC="/etc/admserv"
        export PERL5LIB="/usr/sausalito/perl"
        daemon $ADMSERV -f $conffile

Additionally the PHP scripts for the GUI load and use the 
libraries /usr/sausalito/ui/libPhp/I18n.php 
and /usr/sausalito/ui/libPhp/ServerScriptHelper.php  are supposed to set the 
locale for PHP GUI scripts. 

For that they read what prefered language is stored in CODB (Class: "System"), 
check the system's locale preference and if things don't make a sense, then 
at the worst the language is set back to the hard coded default of English.

Somewhere in there is a bug and/or problem or misunderstaning. 

For starters: The LANG and LC_ALL that the GUI sets in /etc/sysconfig/i18n is 
not entirely the correct one for German. Instead of "de_DE@euro" it may be 
better to use just "de_DE", or "de_DE.UTF-8" (I could be wrong on that). 

In any case setting LC_ALL=de_DE@euro will result in an empty LC_ALL, whereas 
LC_ALL=de_DE.UTF-8 seems to work as intended.

But nonetheless the next problem kicks in when the GUI is accessed. Instead of 
using the selected default language (because we may be using the wrong locale 
values anyway) it doesn't even revert back to English as a safe default. 
Which it should.

But as it doesn't do that the GUI just runs with empty locale settings and 
then you see just the string identifiers instead of the actual localized 
message strings. :o/

Need to troubleshoot this a bit further. Until we have the first extra 
language files for a previously usupported language I should have this 
figured out.

-- 
With best regards,

Michael Stauber
http://www.solarspeed.net