I followed the folling tutorial: http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/
about Php gettext extension (I unchecked the comment in the php.ini)
The gettext is activated but it doesn't show up the translation (German).
Here are the files:
C:\wamp\www\php-test\test.php:
<?php
require_once("localization.php");
echo _("Hello World!");
?>
C:\wamp\www\php-test\localization.php:
<?php
$locale = "de_DE";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");
?>
C:\wamp\www\php-test\locale\de_DE\LC_MESSAGES\messages.po:
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-02-14 00:35+0800\n"
"PO-Revision-Date: 2010-02-14 00:37+0800\n"
"Last-Translator: Jano Chen <[email protected]>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: C:\\wamp\\www\\php-test\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
"X-Poedit-SearchPath-0: .\n"
#: test.php:2
msgid "Hello World!"
msgstr "Hallo Welt!"
C:\wamp\www\php-test\locale\de_DE\LC_MESSAGES\messages.mo
(sorry from some reason I can't copy the text of this file)
When I open it should display "Hallo Welt" (Hello World in German) but instead it displays it in English (Hello World).
Any suggestions?
PS: I'm using Windows XP SP2