萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> 編程語言綜合 >> 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);

  頁面調用

  簡體

  繁體

  英文

copyright © 萬盛學電腦網 all rights reserved