[5.2] Mail Templates language file loading not using the MailsHelper::loadTranslationFiles
Summary of Changes
Load the template language files via the MailsHelper over an manuall code which not handles it correctly for example for plugins.
Testing Instructions
- Install this extension: https://github.com/zero-24/plg_task_extensionupdates/releases
- check the mail templates (system -> Mail Templates -> Extensions Update Notification)
- notice that the mail template is not translated
- apply this patch
- notice the templates are now translated
- check other mail templates
- confirm they are also still translated
Actual result BEFORE applying this Pull Request
On the detail view an mail template shipped with an plugin is not translated
Expected result AFTER applying this Pull Request
Once that patch is applied the issue is solved
Link to documentations
Please select:
- [x] No documentation changes for docs.joomla.org needed
- [x] No documentation changes for manual.joomla.org needed
I have tested this item :red_circle: unsuccessfully on 3ccce67f8be731eeb3d0c02da3e886d30cf0fbf5
After applying the patch i see:
An error has occurred. 0 Class "Joomla\Component\Mails\Administrator\View\Template\MailsHelper" not found
Seems like this line is missing. use Joomla\Component\Mails\Administrator\Helper\MailsHelper;
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.
Yes sorry i have added it to my test Installation but not to the patch. Its added now, please try again. Thanks
I have tested this item :red_circle: unsuccessfully on c903f7c91401988f62f28bf5a27146957ae3b9ea
The added line solved the error indeed.
But after applying the patch, the subject and bodytexts are only in English, even when i select the German flag for example. This occurs to all mailtemplates, not only plg_task_extensionupdates
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.
Hmm need to look into this deeper later. When its happening with and without the patch it looks like a different issue.
I looks like the core templates work in the right language without the patch.
Without the patch your extension only shows English Only when i move your languagefiles to the /administrator/language/de-DE folder it works for German too. (I have the same issue with a plugin i'm developing right now, so i was hoping this was the solution. :) )
Can you see that the german language file is loaded when logged in as german in the language debug?
With the Patch disabled:
With the Patch enabled:
When i change the backend language to german, all mails switch to german (even en-GB as in this screenshot)
Ok so the issue i saw is solved now but the switch of language seams not to be respected not by the current nor by the new coding. That needs more debugging than how it should work and why it does not work right now. Thanks 👍
@JeroenMoolenschot I think i have found the issue, please try again.
I have tested this item :white_check_mark: successfully on 423ec9113dc898d0b469ec5a4b388104bd6a12ec
Thank you! This works for me.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.
@zero-24 Is this a bug fix or a new feature? If bug fix: Does the bug also apply to 4.4-dev? If so, then it should be fixed there, too (or only there and later be merged up to 5.1-dev). But if new feature: Shouldn't it be made for 5.2-dev?
Moved to 5.2 looking forward to tests on this PR so it can be merged.
I have tested this item :white_check_mark: successfully on 53f137eb5cc0857aaa91191985ebb963cfaa8238
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.
Thanks @zero-24 !
Thanks 👍