PrestaShop 1.5.4.1 - mail template translation issue
Posted: 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:
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:
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...
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...