1
0
Fork 0

fix 2nd lang file detecting

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@134 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 17 years ago
parent 47e7def006
commit adfe2d20ad

@ -25,7 +25,12 @@ function get_language_file($name)
global $charset, $lang;
$s = strtolower($charset);
if (isset($lang)) {
$file = get_language_file_ex($name, strtolower($lang), $s);
$l = strtolower($lang);
$file = get_language_file_ex($name, $l, $s);
if (!isset($file)) {
$l = strtok($l, '-');
$file = get_language_file_ex($name, $l, $s);
}
}
else if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
foreach (explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $l) {

@ -25,7 +25,12 @@ function get_language_file($name)
global $charset, $lang;
$s = strtolower($charset);
if (isset($lang)) {
$file = get_language_file_ex($name, strtolower($lang), $s);
$l = strtolower($lang);
$file = get_language_file_ex($name, $l, $s);
if (!isset($file)) {
$l = strtok($l, '-');
$file = get_language_file_ex($name, $l, $s);
}
}
else if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
foreach (explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $l) {

Loading…
Cancel
Save