magento shell脚本如何获取多语言

1
2
3
4
5
6
7
8
9
require 'app/Mage.php'; // here you should use the correct path to Mage.php file

Mage::app();
Mage::getSingleton('core/translate')->init('sv_SE', true); // UPDATE
$to_translate = "String to translate";
$translated = Mage::helper('core')->__($to_translate);

//得到当前网站的语言code
$locale = Mage::app()->getLocale()->getLocaleCode();

 

坚持原创技术分享,您的支持将鼓励我继续创作!