Hi,

Monday, August 4, 2003, 8:25:18 PM, you wrote:

CC> With the following code to translate messages in french,
CC> we need to put the mo files in a directory like

CC> ./local/xxx/LC_MESSAGE/messages.{mo,po}

CC>         putenv("LANGUAGE=french");
CC>         setlocale(LC_ALL, 'fr_BE');
CC>         bindtextdomain("messages", "./local");
CC>         textdomain("messages");
CC>         echo '<br>' . _("Yes");

CC> On one linux webserver, xxx must be 'fr' (and LANGUAGE set).
CC> On another linux webserver, xxx must be 'french' (no var to set).

CC> How can I guess which xxx to use, for my code to work on
CC> any webserver ? Other solution than using 3 or more directories
CC> like 'fr', 'french', 'fr_BE', and copying it?
CC> In fact, I'd like to make it work on windows servers too...

CC> And how can I guess which env var to set (or not) and in
CC> which order (LC_ALL, LANG, LANGUAGE, ...) ? Is there a way
CC> to do it for the code to work nearly everywhere ?
CC> I'll use a class to hide that complexity.

CC> Can someone help ? The PHP documentation is far from beeing
CC> clear and precise enough in that particular field.

CC> ---
CC> Christophe Chisogne
CC> Developper, Publicityweb sprl
CC> http://www.publicityweb.com


Try using

$dir_name = setlocale(LC_MESSAGES);

After setup and that should return the string that gettext will use to
locate its files.

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to