cvs: phpweb /include langchooser.inc

From: Date: Sun, 02 Mar 2003 15:47:42 +0000
Subject: cvs: phpweb /include langchooser.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-15995@lists.php.net to get a copy of this message
goba Sun Mar 2 10:47:42 2003 EDT Modified files: /phpweb/include langchooser.inc Log: Also count with explicit language specifications for search forms... Index: phpweb/include/langchooser.inc diff -u phpweb/include/langchooser.inc:1.8 phpweb/include/langchooser.inc:1.9 --- phpweb/include/langchooser.inc:1.8 Sat Mar 1 15:50:46 2003 +++ phpweb/include/langchooser.inc Sun Mar 2 10:47:42 2003 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: langchooser.inc,v 1.8 2003/03/01 20:50:46 goba Exp $ +// $Id: langchooser.inc,v 1.9 2003/03/02 15:47:42 goba Exp $ /* @@ -12,6 +12,10 @@ After this script run, $LANG is set to the preferred language, or is the empty string, if no manual is available on the current mirror site. + + $EXPL_LANG will also be set to the explicitly provided + language, or will not exist if there are only implications + on the preferred language. The $_SERVER['STRIPPED_URI'] var is also set to the stripped request URI (in case of a shortcut, the @@ -26,6 +30,9 @@ // Default STRIPPED_URI $_SERVER['STRIPPED_URI'] = $_SERVER['REQUEST_URI']; +// Explicit language is not specified +unset($EXPL_LANG); + // Specified for the request (GET/POST parameter) if (isset($_REQUEST['lang'])) { language_add($_REQUEST['lang']); } @@ -43,7 +50,7 @@ // Specified in a manual URL (eg. manual/en/ or manual/pt_br/) if (preg_match("!^/manual/(\\w{2}(_\\w{2})?)(/|$)!", $_SERVER['REQUEST_URI'], $flang)) { - language_add($flang[1]); + $EXPL_LANG = language_add($flang[1]); } unset($flang); @@ -93,6 +100,9 @@ // there already and supported by the PHP site. Try to // lower number of file_exists() calls to the minumum... if (!in_array($langcode, $LANGS) && isset($LANGUAGES[$langcode])) { $LANGS[] = $langcode; } + + // Return with language code + return $langcode; } ?>

« previous php.mirrors (#15995) next »