1

I have configured price alerts for a client (which originally registered into my shop with spanish language).

The user receives the email, but it is in english.

For instance, the text: "You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:" (in ./app/design/frontend/base/default/template/email/productalert/price.phtml) is not being translated to spanish.

I have checked and the translation is present in ./app/locale/es_ES/Mage_ProductAlert.csv: "You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:","Usted está recibiendo esta notificación porque está suscrito para recibir alertas cuando los precios de los siguientes productos cambien:"

I am using a custom theme.

I have also tried to add that translation to my theme: app/design/frontend/mytheme/default/locale/es_ES/translate.csv

I have flushed translations cache and deleted Magento cache. Still not being translated.

Is this a bug? How can I fix it? How can i debug it?

Thanks in advance.

EDIT: BUG SOLVED Ok, I found the fix thanks to Cron job template block not being translated, but testObserver is

What I did: 1) Edit app/code/core/Mage/ProductAlert/Model/Email.php

Replace this (line 255): $appEmulation = Mage::getSingleton('core/app_emulation'); $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

With this: $appEmulation = Mage::getSingleton('core/app_emulation'); $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId); //Dealing with uninitialized translator! Mage::app()->getTranslator()->init('frontend', true);

2
  • Could you please add your solution as an answer here and accept it later so that this question gets resolved? Thanks! Commented Aug 19, 2015 at 16:01
  • Sure, Anna. Please excuse me, I was not aware of the right way to proceed ;) Commented Aug 19, 2015 at 20:38

2 Answers 2

2

The FIX to the bug:

Edit app/code/core/Mage/ProductAlert/Model/Email.php

Replace this (line 255): $appEmulation = Mage::getSingleton('core/app_emulation'); $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

With this: $appEmulation = Mage::getSingleton('core/app_emulation'); $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId); //Dealing with uninitialized translator! Mage::app()->getTranslator()->init('frontend', true);

Now it works :-)

0

Please be sure are you save your .csv file in utf-8?Change email static content to spanish.From app/locale/es_ES/template/email/your-template.html

4
  • Thanks for the reply, Prashant. I had already translated the static contents of app/locale/es_ES/template/email/product_price_alert.html. I have also made sure that the csv file is saved in utf8. Still receiving the mail in english, though. Any more ideas? How can I debug this? Commented Aug 18, 2015 at 19:50
  • also check system->configuration->general->locale is spanish selected ? Commented Aug 18, 2015 at 19:56
  • Yes, it is: Configuración regional = español (España). Every other text in my website is correctly translated. Commented Aug 18, 2015 at 20:36
  • I just found the issue and edited my question. Thanks anyways, Prashant. Commented Aug 19, 2015 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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