Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
i am trying to use the gettext function in PHP i have downloaded the php_gettext.dll file and php_iconv.dll
Here are my php.ini details.
extension_dir=C:\Program Files\xampp\php\ext\
this directory contains above two dll files.
these two lines are uncommented from the ini file.
extension=php_gettext.dll
extension=php_iconv.dll
locale path
C:\Program Files\xampp\test\locale
here is the locale directory structure
fr
LC_MESSAGES
messages.mo
messages.po
Here is the php codeCode: Select all
<?
$locale = 'fr'; // Pretend this came from the Accept-Language header
$locale_dir = 'C:\Program Files\xampp\htdocs\test\locale\\';
putenv("LANGUAGE=$locale");
putenv("LANG=$locale");
bindtextdomain('messages', $locale_dir);
textdomain('messages');
echo gettext("This is my first gettext text......") ;
?>But i dont know why it is not translating the text in french it is displaying as it is in english.
Can anyone know where m i wrong?
Why it is not translating the text?
Thanks
Regards.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]