Re: can't figure out how to solve this ...

From: Date: Tue, 25 Feb 2003 14:51:43 +0000
Subject: Re: can't figure out how to solve this ...
References: 1 2  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-468@lists.php.net to get a copy of this message
Thanks Gary but I found out the solution ... The most important setting for gettext to look the file is the LANGUAGE value, then LC_ALL, LC_MESSAGES and LANG. And as LANGUAGE was defined on the server and I didn't touched it before : it was always looking for fr_FR ... Now, it works fine. Thanks for your help, Robert "Gary Ross" <gary@j-w3.com> wrote in message news:A689DC72-48CC-11D7-A523-0030654E1466@j-w3.com... > Without a web-server? Basically, your browser runs locally the browser > itself and any plugins for obvious security reasons. Javascript works > internally (as such). Once again imagine a Javascript that could run > any stuff on the local machine - a security disaster. I can't see how > you can do what you're asking, but there is a little trick that you can > use if you want to run php or whatever within a static page. Use the > <img> tag. > <img src = "do_something.php" lowsrc = "/shim.gif"> > > Gary > > > On Tuesday, February 25, 2003, at 11:02 pm, Robert Masse wrote: > > > 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_MONET > > ARY=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 > > > > > > > > -- > > PHP Internationalization Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.i18n (#468) next »