Open jaspervriends opened 3 years ago
This ties into https://github.com/flarum/core/issues/2763. Ideally, we could pass in the user whenever translating, but the user is not always available. For this particular case, we could just override the translator locale when executing queued jobs.
Bug Report
Current Behavior Currently email notifications are being sent in the language of the poster (using the user interface language) .
Running international forums with multiple languages would be more interesting if this system works better (or more standardized).
Now, for example, when you have enabled Dutch and English language pack on a forum and a Dutch person replies to an English person, the recipients (and subscribers) will receive a Dutch email about the new post (or mention). The same is happening the way around and with any other type of email.
Steps to Reproduce
Expected Behavior I expect that when an email notification is being sent to a user, the translation keys will check the user language setting (if selected previously) and othwerise fallback to the default forum language.
Screenshots Below you can see the current behaviour when sending emails in different languages.
Environment
Possible Solution There's a
$locale
value in the Translator, but as far as I know this isn't being used in any extension to look at the reciever language. For example, see UserMentionedBlueprint.php#L68 file for mentions and this file in subscriptions).I think it would be great to have something like this properly standardized (or having a different solution) and make sure it's implemented into all core extensions as well.