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);