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.