方法一
此方法的缺點:無法再切換其他輸入法。設定檔路徑:/var/www/html/lists/admin/languages.php
在程式碼@session_start();底下加入$_POST['setlanguage'] = 'zh_TW';
if (!empty($GLOBALS["SessionTableName"])) {
require_once dirname(__FILE__).'/sessionlib.php';
}
@session_start();
$_POST['setlanguage'] = 'zh_TW'; // 加入這行程式碼
if (isset($_POST['setlanguage']) && !empty($_POST['setlanguage']) && is_array($LANGUAGES[$_POST['setlanguage']])) {
## just in case
$setlanguage = preg_replace('/[^\w_-]+/','',$_POST['setlanguage']);
$_SESSION['adminlanguage'] = array(
"info" => $setlanguage,
"iso" => $setlanguage,
"charset" => $LANGUAGES[$setlanguage][1],
"dir" => $LANGUAGES[$setlanguage][4],
);
# var_dump($_SESSION['adminlanguage'] );
}
參考資料:http://selainsoft.blogspot.tw/2008/05/phplist-default-language.html
方法二
優點:改善方法一的缺點。設定檔路徑:/var/www/html/lists/admin/index.php
在開頭加入以下的程式碼:
//設定管理者介面預設語言為繁體中文
$deflanguage;
session_start();
if( !isset( $_SESSION['deflanguage'] )){
$_SESSION['deflanguage'] = 1;
$_POST['setlanguage']="zh_TW";
}
沒有留言:
張貼留言