0

In /app/code/core/Mage/Checkout/controllers/CartController.php I see:

$this->_getSession()->addError(
    $this->__(
       'Coupon code "%s" is not valid.',
        Mage::helper('core')->escapeHtml($couponCode)
    )
);

In my theme's translate.csv I have added:

"Mage_Checkout::Coupon code ""%s"" was applied.","test"
"Coupon code ""%s"" is not valid.","test"

If I edit the controller code directly, it works. The translate.csv does not work -- it still outputs the original text, 'Coupon code "blah" is not valid.'.

I even tried editing the translation in app/locale/en_US/Mage_Checkout.csv but it didn't work either.

What have I missed? Shouldn't it be outputting "test" ??

2

To be sure, you should add the translation scope (i.e. the module name) to both translations:

"Mage_Checkout::Coupon code ""%s"" was applied.","test"
"Mage_Checkout::Coupon code ""%s"" is not valid.","test"

Don't forget to clean the cache after changing translations.

  • It was the cache needing to be cleared! Thank you for reminding me. – Justin Aug 13 '15 at 15:45
  • By the way, it does not need the Mage_Checkout:: scope for this particular translation. – Justin Aug 13 '15 at 15:46
  • Yes, as long as it is globally unique (see magento.stackexchange.com/a/78483/243) – Fabian Schmengler Aug 13 '15 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.