note 23095 added to ref.gettext
| From: | ywliu@php.net | Date: | Tue, 09 Jul 2002 13:39:41 +0000 |
| Subject: | note 23095 added to ref.gettext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32793@lists.php.net to get a copy of this message | ||
Hello,
For users with Red Hat GNU/Linux (at least 6.2) to use gettext, I'd like to make some notes
here :
1. Calling setlocale() is necessary, where calling putenv('LANG=xx_YY') or
putenv('LC_ALL=xx_YY') is not.
2. The country/language code should be in the "language_country" form,such as,
"en_US" or "fr_FR", or any entry in /usr/share/locale/locale.aliase . The simple
ISO two-letter code, such as "en" , is not valid. You can examine the return value of
setlocale to see if the locale setting succeeds.
This took me several hours to debug. I hope my experience can save you some time.
This may apply to other Linux distributions or *BSD systems. I don't know. I hope this helps.
Yen-Wei Liu
--
http://www.php.net/manual/en/ref.gettext.php
http://master.php.net/manage/user-notes.php?action=edit+23095
http://master.php.net/manage/user-notes.php?action=delete+23095
http://master.php.net/manage/user-notes.php?action=reject+23095