【问题标题】:Override Magento Success Message in Contact Us Form在联系我们表单中覆盖 Magento 成功消息
【发布时间】:2013-08-30 04:24:18
【问题描述】:

在 Magento 1.7 中,消息 “您的询问已提交,将尽快回复。感谢您与我们联系。”我们在默认联系我们成功提交时得到的,被

使用
app/code/core/Mage/Contacts/controllers/IndexController.php

模块使用的翻译(.csv)文件是:

app/locale/en_US/Mage_Contacts.csv

我试图覆盖它: app/design/frontend/MyTheme/default/locale/en_US/translate.csv

但是到目前为止一直没有成功...我真的需要使用自定义模块覆盖控制器操作来翻译此消息吗?谢谢。

【问题讨论】:

    标签: magento magento-1.7


    【解决方案1】:

    如果您的系统没有被核心更改,或者没有代码池覆盖,或者现有的重写会更改消息,那么这就是添加该消息的代码行

    Mage::getSingleton('customer/session')
    ->addSuccess(
        Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.')
    );
    

    字符串

    'Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'
    

    通过__ translate/localize 函数传递,这意味着文本可以通过 Magento 的 CSV 和内联翻译功能进行更改。

    这个Magento Stack Exchange question about the translation feature 可以帮助您调试当前系统并解释为什么翻译不能按您认为的方式工作。 (由于你的问题没有提到,我猜是缓存)

    【讨论】:

      猜你喜欢
      • 2013-06-12
      • 2021-06-07
      • 1970-01-01
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 2023-01-03
      相关资源
      最近更新 更多