I'm using the php distribution of www.php4win.de (php4.0.5-rc1-win32-20010316)
which provides quite a lot of nice extensions like gettext.
It was very easy to implement gettext. All functions are working with either php
as module (apache) or cgi.  With the cgi version it is fully functionning, I can
switch the language from one page to the other.

However, with php as module, gettext keeps the language from the first page that
accessed a valid language. LC_TIME is working fine with both.

Example:
Let's see the pages test_fr.php and test_en.php (the only thing that change is
$language)

<?php
$language="fr";
putenv ("LANG=$language");
bindtextdomain ("testgettext", "./locale");
textdomain ("testgettext");
setlocale ("LC_TIME", $language);
print (gettext ("str_hello").",<br>");
print (strftime ("%A, %d %B %Y"))
?>

With php as cgi, everthing is fine
test_fr.php ->
Bonjour,
 dimanche, 01 avril 2001

test_en.php ->
Hello,
Sunday, 01 April 2001

With php as module:

page test_fr.php ->
Bonjour,
dimanche, 01 avril 2001

page test_en.php ->
Bonjour,             (it should be Hello)
Sunday, 01 April 2001 (this is ok)

actually all the pages will appear in french (except the date that is always in
the right language) until....

I restart Apache-php (module) and I call the pages in reverse order:
page test_en.php ->
Hello,
Sunday, 01 April 2001

page test_fr.php ->
Hello,           (it should be Bonjour)
dimanche, 01 avril 2001

Any idea about this problem? Is it due to the multi-threaded type of the module?
Is there a configuration that would prevent this behaviour? I  would prefer to
use php as module to use some of teh features only available on the module type.

Claude Philipona









-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to