Re: Making i18n work on all Unix webservers ?

From: Date: Mon, 04 Aug 2003 13:04:19 +0000
Subject: Re: Making i18n work on all Unix webservers ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-158143@lists.php.net to get a copy of this message
Tom Rogers wrote:
CC> ./local/xxx/LC_MESSAGE/messages.{mo,po}
CC>         setlocale(LC_ALL, 'fr_BE');
CC>         bindtextdomain("messages", "./local");
CC>         textdomain("messages");
CC> How can I guess which xxx to use, for my code to work on CC> any webserver ? Try using $dir_name = setlocale(LC_MESSAGES); After setup and that should return the string that gettext will use to locate its files.
Thanks. But it looks like it's more complicated. setlocale(LC_MESSAGES,'0') returns fr_BE, but it seems PHP looks in ./local/fr, not in ./local/fr_BE when searching the catalog files, at least on one webserver. (using PHP 4.1.2, the other PHP 4.2.3). I guess there is some kind of search path to locate the catalog files, with some preference order. Too bad the i18n PHP thing isn't more predictable :-/ Of course, I restarted the webserver (apache reload) between tests, to avoid problems with the gettext cache. I think I'll simply copy ./locale/french to fr, fr_BE, fr_FR And something similar for dutch and german. But I thought there was some better and cleaner way to do it, in a more manageable way. -- Christophe Chisogne http://www.publicityweb.com

« previous php.general (#158143) next »