Magento shell script执行过程中不会Initialize locale,如果需要在script中使用traslation,可以尝试..
<?php
require_once 'abstract.php';
/**
* Magento Compiler Shell Script
*
* @category Mage
* @package Mage_Shell
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Shell_Myscript extends Mage_Shell_Abstract {
/**
* Initialize application and parse input parameters
*
*/
public function __construct()
{
parent::__construct();
Mage::getSingleton('core/translate')->init('frontend', true);
}
//your business
}