note 34022 added to ref.gettext

From: Date: Mon, 14 Jul 2003 06:15:35 +0000
Subject: note 34022 added to ref.gettext
Groups: php.notes 
Request: Send a blank email to php-notes+get-52061@lists.php.net to get a copy of this message
I had a lot of problems getting gettext to work (RedHat 7.3). After reading ALL the comments in this manual, I got it to work OK. In summary, take care that: 1) You use a full locale in the setlocale() 2) Your language_country exists in the /usr/share/locale/locale.alias 3) It seems that Apache needs to be restarted (a "graceful" did the trick for me) 4) Your .mo files must be named after the domain My code: $language = "es_ES"; $locale = setlocale(LC_ALL, $language); $gettext_domain = 'messages'; bindtextdomain($gettext_domain, "/full/path/to/locale"); textdomain($gettext_domain); ---- Manual Page -- http://www.php.net/manual/en/ref.gettext.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34022 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34022&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34022&report=yes

« previous php.notes (#52061) next »