Fix a bug when there no language sent (many OPDS client do that).
这个提交存在于:
父节点
211f90e2f3
当前提交
62a6e1d412
共有 1 个文件被更改,包括 5 次插入 和 1 次删除
6
base.php
6
base.php
|
@ -48,7 +48,11 @@ function localize($phrase) {
|
|||
static $translations = NULL;
|
||||
/* If no instance of $translations has occured load the language file */
|
||||
if (is_null($translations)) {
|
||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||
$lang = "en";
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||
}
|
||||
$lang_file_en = NULL;
|
||||
$lang_file = 'lang/Localization_' . $lang . '.json';
|
||||
if (!file_exists($lang_file)) {
|
||||
|
|
正在加载…
添加表格
添加链接
在新工单中引用