I'm using gettext
to localize my web app. So far, I was able to get it working with a simple example, as follows :
<?php
$dir = "../locale";
$lang="fr_FR";
$domain="messages";
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);
bindtextdomain ($domain, $dir);
textdomain ($domain);
echo gettext("TEST 1") . "\n";
echo __("Test 2"); // works if using gettext("Test 2");
?>
As you see, the last line tries using "__" instead of "gettext" which I read in several posts to be equivalent... So why is it not translating when using echo __("Test 2");
?
Should I do a global replace in my source to replace all __("
with gettext("
?