note 74741 added to ref.gettext

From: Date: Wed, 25 Apr 2007 22:37:48 +0000
Subject: note 74741 added to ref.gettext
Groups: php.notes 
Request: Send a blank email to php-notes+get-125867@lists.php.net to get a copy of this message
I'm sure I'll confuse further, but I feel compelled to chime in. I got stuck on this a bit... It's absolutely critical that your gettext installation supports the locale you are trying to use in your setlocale(LC_MESSAGES,$locale) call. This does not work: setlocale(LC_MESSAGES,"en"); in OpenSUSE 10.2, because /usr/lib/locale does not contain the directory "en" (out of the box), even though your custom LC_MESSAGES domain location might. In OpenSUSE 10.2, at least, /usr/lib/locale contains for USA English: en_US en_US.iso885915 en_US.utf8 (again, not "en"). It might be possible to set up an alias, I'm not sure (does anyone have a idea about this). My goal was to use HTTP_ACCEPT_LANGUAGE to set locale (I realize that locale != language, but it seems that gettext uses locale to assign language (scratches head) ). Opera in OS X does not send "en_US". However, Firefox does out of the box. I'm not sure if it's supposed to work this way, but it seems like it should, and so the way Opera handles this appears to be an issue. Incidentally, Safari simples send "en" in HTTP_ACCEPT_LANGUAGE, and will also not work. This compelled me to set a configurable default locale (e.g "en_US") in my PHP app, which one probably should do anyway, because HTTP_ACCEPT_LANGUAGE might be blank. ---- Server IP: 64.71.164.2 Probable Submitter: 128.119.52.172 ---- Manual Page -- http://www.php.net/manual/en/ref.gettext.php Edit -- https://master.php.net/note/edit/74741 Del: integrated -- https://master.php.net/note/delete/74741/integrated Del: useless -- https://master.php.net/note/delete/74741/useless Del: bad code -- https://master.php.net/note/delete/74741/bad+code Del: spam -- https://master.php.net/note/delete/74741/spam Del: non-english -- https://master.php.net/note/delete/74741/non-english Del: in docs -- https://master.php.net/note/delete/74741/in+docs Del: other reasons-- https://master.php.net/note/delete/74741 Reject -- https://master.php.net/note/reject/74741 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125867) next »