PrestaShop 1.5.4.1 - mail template translation issue

In this board, we will periodically list various tips and tricks we find that may help in your use of PrestaShop. This will also include tips on the use of Agile modules. If you have a great tip, fix, or workaround for a PrestaShop feature, feel free to post it here...

PrestaShop 1.5.4.1 - mail template translation issue

Postby shokinro » Fri May 10, 2013 3:33 am

What is the problem?

If you are using PrestaShop 1.5.4.1 (latest version at time of this post), and you try to translate email templates using the back office translation function:

- back office --> Localization --> Translations --> choose "Email template translations"

When you enter the translation contents or subject translation, and you click "Save", you may find nothing has been saved.

And, you will see following error message:

Cannot write language file for email subjects. Path is: /public_html/themes/default/mails/en/lang.php


If you turn on development mode by setting "set _PS_DEV_MODE_" to true, and try the same operation again, you will see errors similar to the following:

Warning: file_put_contents(/public_html/themes/default/mails/si/account.html) [function.file-put-contents]: failed to open stream: No such file or directory in /public_html/controllers/admin/AdminTranslationsController.php on line 1457

Warning: file_put_contents(/public_html/themes/default/mails/si/backoffice_order.html) [function.file-put-contents]: failed to open stream: No such file or directory in /public_html/controllers/admin/AdminTranslationsController.php on line 1457

.......



The Cause
============
Apparently PrestaShop is changing the folder structure for the mail folder, from /mails/ to /themes/default/mails/

However, this change it not yet finished. Some pages are using the new structure, but others are still using the old structure and actual files are still remaining in the /mails/ folder.

Solutions
==============

Solution 1:
You can choose to translate the files by opening the email template files directly, and write the translations directly to the files.
For mail subject translations you can change the following file

/YourStoreRoot/mails/xx/lang.php

where xx is iso code of the language you want to translate. (es for Spanish, fr for French,....)

Solution 2:
Here we introduce a workaround if you still want to use back office translation tool.

A. Copy all mail files to the location the translation tool is looking in.

From
YourStoreRoot/mails/

To
YourStoreRoot/themes/YourTheme/mails/


B. Perform the translations from the back office as usual.

C. After finishing the translations, copy all email files back to their original location.

--------

Hope this helps...
Follow us at Twitter Like us on Facebook Watch our Tutorial Videos on YouTube
shokinro
Site Admin
 
Posts: 3091
Joined: Sat Jun 25, 2011 3:08 pm

Re: PrestaShop 1.5.4.1 - mail template translation issue

Postby darwinco_1695 » Fri Feb 07, 2014 4:11 am

Hi!

Regarding to this post:

1. My solution: I am using PrestaShop 1.5.4.1, I can translate my email templates using the back office translation function:

- back office --> Localization --> Translations --> choose "Email template translations" --> choose "core (no theme selected)"

In the second drop list, instead of "default" you choose "core (no theme selected)"

2. My problem: "email subject" doesn't appear, the only problem is in "subjects", they are not either in lang.php file

Emails for agilemultipleseller module http://standsbogota.com/1.jpg

Emails for other modules http://standsbogota.com/2.jpg

How can I translate my "mail subjects" for agilemultipleseller module 2.1.5.? (i.e. Your seller account approved!)‏

Appreciate your help and comments, thanks.

Regards
darwinco_1695
 
Posts: 19
Joined: Mon Jul 02, 2012 7:01 pm

Re: PrestaShop 1.5.4.1 - mail template translation issue

Postby shokinro » Wed Feb 12, 2014 6:12 am

Thanks for using our modules.
For mail subject, because there was bug in some version of PrestaShop mail subject translation, it does not work properly.
so we changed to not use normal text translation instead of mail subject translation. Please try to find the text "New Order" and translate it for new order email subject in agile multiple seller module translation.
Follow us at Twitter Like us on Facebook Watch our Tutorial Videos on YouTube
shokinro
Site Admin
 
Posts: 3091
Joined: Sat Jun 25, 2011 3:08 pm


Return to Tips and Tricks for PrestaShop and Agile Modules

Who is online

Users browsing this forum: No registered users and 3 guests