gettext not working under local xampp
Posted: Mon Apr 12, 2010 8:27 am
Hello
I have a problem.
Altough I got gettext working under a remote server environment, I have not got it working yet under a local XAMPP installation. I have made sure that gettext is enabled by going to http://localhost and looking into phpinfo.
The code is really simple:
The website display the original string "This website is written in English" instead of translating it into Spanish like it should according to the po file I wrote with poedit.
Any idea?
Thanks
I have a problem.
Altough I got gettext working under a remote server environment, I have not got it working yet under a local XAMPP installation. I have made sure that gettext is enabled by going to http://localhost and looking into phpinfo.
The code is really simple:
Code: Select all
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.arreglaordenador.com" );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
$language="es_ES";
putenv("LC_ALL=$language");
setlocale(LC_ALL, $language);
bindtextdomain("messages", "./locale");
textdomain("messages");
print "<p>"._("This website is written in English")."</p>\n";
?>
</body>
</html>
Any idea?
Thanks