Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Mail Templates language file loading not using the MailsHelper::loadTranslationFiles #43475

Open
wants to merge 7 commits into
base: 5.1-dev
Choose a base branch
from

Conversation

zero-24
Copy link
Contributor

@zero-24 zero-24 commented May 15, 2024

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

  1. Install this extension: https://github.com/zero-24/plg_task_extensionupdates/releases
  2. check the mail templates (system -> Mail Templates -> Extensions Update Notification)
  3. notice that the mail template is not translated
  4. apply this patch
  5. notice the templates are now translated
  6. check other mail templates
  7. 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
image

Expected result AFTER applying this Pull Request

Once that patch is applied the issue is solved
image

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@JeroenMoolenschot
Copy link
Member

JeroenMoolenschot commented May 23, 2024

I have tested this item 🔴 unsuccessfully on 3ccce67

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.

@zero-24
Copy link
Contributor Author

zero-24 commented May 23, 2024

Yes sorry i have added it to my test Installation but not to the patch. Its added now, please try again. Thanks

@JeroenMoolenschot
Copy link
Member

I have tested this item 🔴 unsuccessfully on c903f7c

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.

@zero-24
Copy link
Contributor Author

zero-24 commented May 23, 2024

Hmm need to look into this deeper later. When its happening with and without the patch it looks like a different issue.

@JeroenMoolenschot
Copy link
Member

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. :) )

@zero-24
Copy link
Contributor Author

zero-24 commented May 23, 2024

Can you see that the german language file is loaded when logged in as german in the language debug?

@JeroenMoolenschot
Copy link
Member

With the Patch disabled:
afbeelding

With the Patch enabled:
When i change the backend language to german, all mails switch to german (even en-GB as in this screenshot)
afbeelding

@zero-24
Copy link
Contributor Author

zero-24 commented May 23, 2024

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 👍

@zero-24
Copy link
Contributor Author

zero-24 commented May 23, 2024

@JeroenMoolenschot I think i have found the issue, please try again.

@JeroenMoolenschot
Copy link
Member

I have tested this item ✅ successfully on 423ec91

Thank you! This works for me.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43475.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants