ecshop多语言切换
Ecshop灵活切换多种语言_ecshop前台多语言切换
打开includds/init.php 粘贴代码到200行左右if (!defined(‘INIT_NO_USERS’)) 上面
if(!empty($_REQUEST[‘lang’])){
$_SESSION[‘lang’]=$_REQUEST[‘lang’];
}
if (!empty($_SESSION[‘lang’]))
{
switch($_SESSION[‘lang’]){
case ‘zh_cn’:
$_CFG[‘lang’]=”zh_cn”;
break;
case ‘zh_tw’:
$_CFG[‘lang’]=”zh_tw”;
break;
case ‘en_us’:
$_CFG[‘lang’]=”en_us”;
break;
}
}
require(ROOT_PATH . ‘languages/’ . $_CFG[‘lang’] . ‘/common.php’);
$smarty->assign(‘lang’, $_LANG);
删除原
require(ROOT_PATH . ‘languages/’ . $_CFG[‘lang’] . ‘/common.php’);
$smarty->assign(‘lang’, $_LANG);
页面调用
<a href=”?lang=zh_cn”>简体</a>
<a href=”?lang=zh_tw”>繁体</a>
<a href=”?lang=en_us”>英文</a>