覆盖块时避免丢失翻译

时间:2013-01-21 15:13:39

标签: php magento

如果我重写块并且开发者模式处于活动状态,则不再显示标准翻译。如何让Magento回归模块的原始翻译。

这与Magento: Avoid loss of translations when rewriting controllers

有关

1 个答案:

答案 0 :(得分:6)

可以覆盖块中用于确定应使用哪些翻译的模块名称:

class Acme_GreatModule_Block_Customer_Account_Navigation extends Mage_Customer_Block_Account_Navigation
{
    /**
     * Set the original module name to avoid breaking translations
     */
    public function __construct()
    {
        parent::__construct();
        $this->setModuleName('Mage_Customer');
    }     
...