Skip to content

[stack] feat(mail): support right-to-left languages in emails - #65312

Merged
skjnldsv merged 1 commit into
masterfrom
feature/mail-template-rtl
Oct 8, 2026
Merged

skjnldsv merged 1 commit into
masterfrom
feature/mail-template-rtl

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

Builds on #65296. Emails ignored the recipient's language for layout: everything was lang="en", left to right, so Arabic or Hebrew mails had text stuck to the left, punctuation on the wrong side and the note bar on the wrong edge.

IEMailTemplate::setLanguage() fixes that: it sets lang and dir on the email, mirrors the layout for right-to-left languages, and is the default language for the footer. Every email in server now passes the language it's written in.

The mirroring swaps left and right in the template's own styles only (style attributes and the style element), so text like "Turn left" is never touched. Logical CSS properties would be nicer, but mail clients don't support them.

Before After (light) After (dark) Mobile
Share mail in Arabic before-share-ar-light-700 after-share-ar-light-700 after-share-ar-dark-700 after-share-ar-light-375

Rendered with the server's real Arabic translations. Strings added in this release ("Note", "Valid until", the footer) aren't translated yet.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests are included
  • Screenshots before/after for front-end changes
  • Documentation has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable
  • Milestone added for target branch/version

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Oct 8, 2026
@skjnldsv skjnldsv self-assigned this Oct 8, 2026
@skjnldsv
skjnldsv requested review from Altahrim, leftybournes, salmart-dev and sorbaugh and removed request for a team October 8, 2026 12:21
@skjnldsv
skjnldsv requested review from jancborchardt and nickvergessen and removed request for sorbaugh October 8, 2026 12:58
@skjnldsv
skjnldsv added this pull request to stack #65223 October 8, 2026 12:58
@skjnldsv
skjnldsv force-pushed the feature/mail-template-rtl branch from 6e3b09e to 8eca3e1 Compare October 8, 2026 13:00

@jancborchardt jancborchardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice except the missing translations, but proper review better to be done by @hamza221 and @mabkenar :)

@hamza221 hamza221 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing ✅ 🤩
Only one Nit when text is majority english (LTR) I would expect it to be LTR, But certainly not blocking hence the approval.

Image

@skjnldsv

skjnldsv commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Only one Nit when text is majority english (LTR) I would expect it to be LTR, But certainly not blocking hence the approval.

I think it's just because it's a new string and haven't a translation yet. I'm not sure we can actually differenciate line per line if we render ltr or rtl. This should be fixed the moment our translations gets updated :)

Base automatically changed from feature/mail-template-followups to master October 8, 2026 19:20
IEMailTemplate::setLanguage() sets the lang and dir attributes of the
email, mirrors the layout for right-to-left languages and becomes the
default language of the footer. Every email sent by server now passes
the language it is written in.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the feature/mail-template-rtl branch from 8eca3e1 to 9629175 Compare October 8, 2026 19:20
@skjnldsv
skjnldsv merged commit 859e88a into master Oct 8, 2026
157 of 158 checks passed
@skjnldsv
skjnldsv deleted the feature/mail-template-rtl branch October 8, 2026 19:20
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.

4 participants