php-i18n Digest 25 Feb 2003 14:15:55 -0000 Issue 154

Topics (messages 465 through 465):

can't figure out how to solve this ...
        465 by: Robert Masse

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello you all,

I have a problem using gettext with PHP 4.3.1 :

If I put :

putenv("LANG=en_CA");
$setloc = setlocale(LC_ALL, "");

the value of $setloc shows me that the LC_xxx variables have been set to
en_CA, *excepted* for the following ones :
LC_CTYPE=fr_FR;LC_NUMERIC=fr_FR;LC_TIME=fr_FR;LC_COLLATE=fr_FR;LC_MONETARY=f
r_FR;LC_MESSAGES=fr_FR
I suppose this is because those ones are defined on the server.

It means that gettext will look in ./locale/fr_FR/LC_MESSAGES to find the
translation file and, of course, it means that no matter which language I
choose, it will *always* use the same file.

I tried using setlocale(LC_MESSAGES, en_CA) which seems to work (return
value = "en_CA") but, anyhow, gettext still uses the same fr_FR value to
find the translation file.

If I try to change the LC_MESSAGES value by hand in the shell, the value is
changed but has no effect on my script results.
If I do not put setlocale(), gettext never translates anything even with
LANG set to something.

In short : if I use setlocale(), the system ALWAYS use fr_FR and if I do not
use setlocale() it doesn't translate at all ...

Could someone help me ?

Robert Masse



--- End Message ---

Reply via email to