note 77569 deleted from ref.gettext by nlopess
| From: | nlopess@php.net | Date: | Tue, 04 Sep 2007 15:13:57 +0000 |
| Subject: | note 77569 deleted from ref.gettext by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130169@lists.php.net to get a copy of this message | ||
Note Submitter: bodypheo [at] gmail.com
----
Hello all,
I am having some troubles with gettext, I hope some of you can help me.
Well I have the next code:
<?php
$language = "es_ES";
if (isset($_GET["locale"])) $language = $_GET["locale"];
putenv("LANG=$language");
$locale = setlocale(LC_ALL, $language);
echo $language;
$gettext_domain = 'messages';
bindtextdomain($gettext_domain, "./locale");
textdomain($gettext_domain);
echo _("cadena");
echo "<br />";
phpinfo();
?>
and under directory I have:
locale/
/en
/LC_MESSAGES
messages.mo
messages.po
/es_ES
/LC_MESSAGES
messages.mo
messages.po
/fr_FR
/LC_MESSAGES
messages.mo
messages.po
messages.mo and po are exactly the same file and they have been compiled with msgfmt under the linux
server.
When I open page by default it sends es_ES and string is changed properly, but it does not work when
I put en or fr_FR in the file.
Anyone can see the problem?
server was restarted after many test and error with no solution.