覆盖块时避免丢失翻译

Ale*_*lex 2 php magento

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

这与Magento有关:避免在重写控制器时丢失翻译

Ale*_*lex 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');
    }     
...
Run Code Online (Sandbox Code Playgroud)