Re: [PHP] gettext() troubles

2005-09-23 Thread Jochem Maas

Aaron Gould wrote:

Denis Gerasimov wrote:







anyone who has worked with locales on different machines/platforms
will probably run into the problem that locales are different and/or
differently named on alot of systems...

for this reason (I believe) set_locale() allows you to pass
an array of locale names as the second arg - the first one found will be used...

e.g. (I use dutch locales alot):

setlocale( LC_ALL,
   array('[EMAIL PROTECTED]',
 'nl_NL',
 'nld_nld',
 'Dutch',
 'Dutch_Netherlands.1252',
 'nl_NL.ISO8859-1',
 'nl') );

maybe that helps a bit.



Here's what I use to set my language (to French in this case). It works 
100% of the time for me:


  // Set locale to preferred language
  setlocale(LC_ALL, 'fr_FR');
  bindtextdomain('messages', $_SERVER['DOCUMENT_ROOT'].'/locale');
  textdomain('messages');

I don't do the "putenv" line that you have, so I'm not sure if it's 
necessary...


it sometimes is I believe - depends on your setup (e.g. if your using CGI 
version)
- don't hold me to that I could be completely wrong.





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



Re: [PHP] gettext() troubles

2005-09-23 Thread Aaron Gould

Denis Gerasimov wrote:




Here's what I use to set my language (to French in this case). It works 
100% of the time for me:


  // Set locale to preferred language
  setlocale(LC_ALL, 'fr_FR');
  bindtextdomain('messages', $_SERVER['DOCUMENT_ROOT'].'/locale');
  textdomain('messages');

I don't do the "putenv" line that you have, so I'm not sure if it's 
necessary...


--
Aaron Gould
Programmer/Systems Administrator
PARTS CANADA

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