7 comments
Comment from: dAniel [Visitor]
dAniel

I use the following code for gettext initialisation (i12n :)):

function init_gettext($language){
putenv('LANGUAGE='.$language);
putenv('LANG='.$language);
// Specify location of translation tables
bindtextdomain ("messages", "./locale");
// Choose domain
textdomain ("messages");

if ($language=='de') $loc = setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); else $loc=setlocale(LC_ALL, 'en','en_US');
}

and could not recognize your above mentioned problem.

This was my testcode and it always resulted in the correct displaying:

echo 'using '.$site->lang;
echo _('welcome on thequod.de');
sleep(5);
if ($site->lang=='de') $site->lang='en'; else $site->lang='de';
init_gettext($site->lang);
echo 'using '.$site->lang;
echo _('welcome on thequod.de');

The tricky thing about init_gettext() is, that my remote server needs the setlocale() command, where my local server does not.

2003-09-29 @ 17:40
Comment from: François PLANQUE [Visitor]
François PLANQUE

You probably use PHP through CGI and not through and Apache module.

Gettext works fine if you use CGI. It does not if you use mod_php.

2003-09-29 @ 18:25
Comment from: dAniel [Visitor]
dAniel

No, I use it as a module.
LoadModule php4_module c:/www/php/sapi/php4apache.dll

But there is no clue about mod_php in phpinfo(), where my server says ‘mod_php’.

See http://blueye.kicks-ass.net/iphp.php (local) and http://thequod.de/iphp.php (remote).

2003-09-29 @ 19:04
Comment from: abbi [Visitor]
abbi

i love u

2003-12-15 @ 18:53
Comment from: guest [Visitor]
guest

From the PHP manual:

“Adds setting to the server environment. The environment variable will only exist for the duration of the current request. At the end of the request the environment is restored to its original state.”

2004-06-10 @ 15:03
Comment from: dAniel hAhler [Visitor]
dAniel hAhler

Without having looked at the gettext implementation in PHP recently, I’d say it really cannot be as bad as you’ve outlined (in 2003).

2006-03-09 @ 02:24
Comment from: [Member]

Yeah right! Everyone has upgraded Windows XP/2003 Server, Apache 1.3 and PHP 4 since 2003. It’s a known fact that these versions are no longer in use, except by a tight minority…

(95% is a minority, isn’t it?)

2006-03-15 @ 21:35


Form is loading...