can't figure out how to solve this ...
| From: | Robert Masse | Date: | Tue, 25 Feb 2003 14:02:12 +0000 |
| Subject: | can't figure out how to solve this ... | ||
| Groups: | php.i18n | ||
| Request: | Send a blank email to php-i18n+get-465@lists.php.net to get a copy of this 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