Magento: Avoid loss of translations when rewriting controllers

泄露秘密 提交于 2019-12-08 04:01:25

The solution is very simple. Just specify module name that should be used in controller to translate strings.

  • Specify value for $_realModuleName property of the class.

Example:

class My_Foo_SomeController extends Mage_Checkout_SomeController 
{

    protected $_realModuleName = 'Mage_Checkout';

    // Some your code goes here
}

In this case Magento will use value from this property to retrieve module translations instead of trying to detect module name from class name.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!