Kleijn36 Posted October 15, 2019 Posted October 15, 2019 We are busy with the last translations for emails, for some emails it is possible to translate the email subject but not for all. Is it possible to make the others with no email subject field translatable in the next release or update? 1
datakick Posted October 16, 2019 Posted October 16, 2019 I'm afraid that can't be done at the moment. Email subject translation works strangely - thirtybees is going through all php files on your system and looking for this pattern Mail::send(1, 'template-name', Mail::l('Subject')) When it finds this pattern, it notes that email template with name 'template-name' uses subject 'Subject', and offers it for translation (translation is performed within Main::l method during runtime) Unfortunately, this means that emails subjects and template must be hardcoded in the php code in order for them to be translatable. If there is some code that dynamically chooses email template, then translation doesn't work. Take following code for example: $template = 'template-name'; $subject = 'Subject'; Mail::send(1, $template, Mail::l($subject)); It should, theoretically, do the same as the previous snippet. The only change is that constants are extracted to variables. But, in this case, thirtybees's static analysis is unable to determine the association between 'template-name' and 'Subject' There are many emails in the system that are using this dynamic way. For example, emails regarding order status changes. Because order statuses are not hardcoded (you can create new one in back office), email subject can't be hardcoded in php codebase as well. And, therefore, they are not translatable using standard mechanism. Note that order status change emails use order status name as a subject, so you can modify order status name to tweak email subject. Or, you can use my conseqs module and replace subject on the fly  1
Sigi Posted May 19, 2020 Posted May 19, 2020 On 10/16/2019 at 7:23 AM, datakick said: so you can modify order status name to tweak email subject. any hint how to do this?
toplakd Posted May 19, 2020 Posted May 19, 2020 (edited) 30 minutes ago, Sigi said: any hint how to do this? Click on edit and add new status name 🙂 Edited May 19, 2020 by toplakd 1
datakick Posted October 25, 2023 Posted October 25, 2023 This functionality is now in bleeding edge. You can now set custom email subjects for your order statuses 2 1
zen Posted September 22 Posted September 22 (edited) I do encounter problems with french emails translations.. when I delete the directory and click on update .. it downloads english themes translations/ templates on the mails/fr directory In order to get translated emails, I used an old website and export emails from there and upload it. Edited September 22 by zen
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now