0

After using a lot of time trying to translate Magento strings using translate.csv without any luck, I am now using a plugin called PHPro Translate.

In this, I can search for all strings in my shop and translate them one by one.

However, I can't seem to translate the strings used in e-mail templates. In my items.phtml, I have $this->__('Item in your order') and $this->__('Items in your order') that show up in english, even though my shop is in danish language.

Can someone please help me sort this out so I can translate the strings and get them to show up correctly?

Thanks!

1 Answer 1

0

UPDATE: After some discussion in the comments below this answer it appeared that there were some custom text strings in the file

app/design/frontend/rwd/{theme}/template/email/order/items.phtml

The issue was solved by adding translations for those strings in

app/locale/da_DK/Mage_Sales.csv

Original answer below this line


Email template files are located in app/locale/yourlanguage_YOURLANGUAGE/template/email/

In your case, all Danish email translation files should be in

app/locale/da_DK/template/email/

If there are no Danish email files in this location then you should copy all email templates from app/locale/en_US/template/email/ to the Danish directory and translate them.

I'm sure Danish email templates can be found on the web.

8
  • Thanks. I have localized that file, and made the correct changes in it. Problem is that it collects list of items in the order from the file 'items.phtml'. In which folder would I place a danish version of this? Commented Aug 11, 2015 at 9:20
  • Can you post the entire path to the items.phtml file which your installation is using? By default Magento CE 1.9.2.1 is using app/design/frontend/base/default/template/sales/order/items.phtml and the string is <?php echo Mage::helper('core')->quoteEscape($this->__('Items Ordered')) ?>. Notice the difference? "Items Ordered" is translated in app/locale/en_US/Mage_Sales.csv by default.
    – MatthijsIJ
    Commented Aug 11, 2015 at 9:44
  • The file is in the folder you mention - in my case /app/design/frontend/rwd/{theme}/template/email/order. I guess the guy who originally set up the store has altered some things along the way. Maybe he made this change to support both Item and itemS ordered. Can I just implement both strings with your code? <?php echo Mage::helper('core')->quoteEscape($this->__('Item Ordered')) ?> and <?php echo Mage::helper('core')->quoteEscape($this->__('Items Ordered')) ?> Commented Aug 11, 2015 at 9:56
  • Based on your original question I would suggest adding both "Item in your order","Singular Danish translation" and "Items in your order","Plural Danish translation" to your app/locale/da_DK/Mage_Sales.csv file. Also don't forget to refresh all cache. Let me know if this works for you
    – MatthijsIJ
    Commented Aug 11, 2015 at 10:06
  • Thx. But isn't it bad practice to make changes in this core file? Commented Aug 11, 2015 at 10:33

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.