Browse Source

fix 2nd lang file detecting

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@134 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 15 years ago
parent
commit
adfe2d20ad
  1. 7
      admin/common.php
  2. 7
      coverager/common.php

7
admin/common.php

@ -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) {

7
coverager/common.php

@ -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