gettext problems
Posted: Sat Oct 28, 2006 2:43 pm
Hello!
I try to make translate my site with gettext function.
I have reade thins manual: http://pl.php.net/manual/pl/function.gettext.php
But I have problem.
Languages on my main page changes with sessions, like this:
Everything Works, but don't work in other scripts. So i tried to translate them with gettext.
In main file of the script I put:
Exapmle .MO file:
Path is corect as follow:
C:\usr\apache\httpd\html\news\lang\de_DE\LC_MESSAGES.
I call this by:
And don't work.
Anyoe know what I'm doing wrong?
I try to make translate my site with gettext function.
I have reade thins manual: http://pl.php.net/manual/pl/function.gettext.php
But I have problem.
Languages on my main page changes with sessions, like this:
Code: Select all
<?php
session_start();
require_once("langman.php");
if(!SelectLanguage($_SESSION["lang"]))
die("Error selecting language!");
?>Everything Works, but don't work in other scripts. So i tried to translate them with gettext.
In main file of the script I put:
Code: Select all
setlocale(LC_ALL, $_SESSION["lang"] );
bindtextdomain("news", "./lang");
textdomain("news");Code: Select all
msgid "Football"
msgstr "Fussbal"C:\usr\apache\httpd\html\news\lang\de_DE\LC_MESSAGES.
I call this by:
Code: Select all
echo _("Football");Anyoe know what I'm doing wrong?