|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-16 16:09 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 20:00:01 2025 UTC |
The following has been discussed with Gorba, but he didn't have the time to look into it and requested I reported it here. Basically - manual-lookup.php already is prepared for a language. Search.php however, doesn't know about it. The following unified diff, shows a basic implementation of how it can be supported. Without this, even if you read the english manual, the search box, will direct you to the manual, in the default language for the mirror you're visiting. This may not be what you want. --- ./search.php.dist Wed Jan 9 20:19:14 2002 +++ ./search.php Fri Jan 11 00:58:26 2002 @@ -13,11 +13,19 @@ if (isset($prevsearch) && get_magic_quotes_gpc()) $prevsearch = stripslashes($prevsearch); +if (isset($lang) && get_magic_quotes_gpc()) +{ + $lang = stripslashes($lang); +} +else +{ + $lang = ereg_replace("^([a-z]{2}).*$", "\\1". $HTTP_ACCEPT_LANGUAGE); +} if ($pattern) { setcookie("prevsearch",$pattern,0,"",".php.net"); if ($show=="quickref") { - header("Location: manual-lookup.php?pattern=".urlencode($pattern)); + header("Location: manual-lookup.php?pattern=".urlencode($pattern)."&lang=".urlencode($lang)); exit; } $location = "http://www.progressive-comp.com/Lists/"; @@ -59,7 +67,7 @@ header("Location: ".$location."?".$query); exit; } -} +} if (file_exists("configuration.inc")) { include_once 'configuration.inc'; @@ -101,6 +109,7 @@ ?> <h1>Search</h1> <form action="<?php echo $form;?>" method="post"> +<input type="hidden" name="lang" value="<?php echo htmlspecialchars($lang); ?>"> <table cellspacing="0" cellpadding="2" border="0" align="center"> <tr valign="top"> <td align="right">