Topic on Project:Support desk

How to make ContactPage "message body" output RTL?

7
182.232.193.236 (talkcontribs)

Mediawiki 1.34.2 in Hebrew with ContactPage.

I have tested my ContactPage contact form and the output I got in my email client Gmail was generally fine besides that the "message body" output is Left To Right (LTR) Instead Right To Left (RTL) and it is also aligned to the left (of the document) instead of being aligned to the right (of the document).

Current output format:

מספר הטלפון שלך: 0500000000
אתר (אם יש): example.com
תפקיד בארגון (אם יש): מנכ"ל

Desired output format:

מספר הטלפון שלך: 0500000000
אתר (אם יש): example.com
תפקיד בארגון (אם יש): מנכ"ל

Interim note

This problem doesn't exist with headings/titles --- headings are indeed RTL even if they include special characters and/or English (unlike the "message body"); perhaps because the headings are reformatted by Gmail but "message bodies" aren't.

My question

How to make ContactPage "message body" output RTL?

Jonathan3 (talkcontribs)

If you think it’s Gmail then try with a different one and compare.

Maybe best to ask this on the extension talk page?

182.232.193.236 (talkcontribs)

@Jonathan3 I think that the "message body" output is LTR because of MediaWiki; thus I seek a way to make it RTL from MediaWiki.

Bawolff (talkcontribs)

so email is a bit of a mess when it comes to directionality and can vary between email clients.


I am just talking generally here and not about this specific extension (i have no idea what it does)

Rich text email is the most reliable approach, where you can use html (e.g. <div dir="rtl" lang="he">...body of email... </div>) to specify the desired directionality. This works effectively and consistently and is the best choice but im not sure the extension supports that.

If that is not an option (i.e. only plaintext email is supported), the second best approach is to add hidden unicode control characters. You need to make the email start with a U+202B RIGHT-TO-LEFT EMBEDDING at the very beginning, and end with a U+202C POP DIRECTIONAL FORMATTING. If you are editing LocalSettings.php, you can write these characters as "\u{202B}rest of starting text" and use \u{202C} for the pop directional formatting character. Note this only works with double quotes (") not single quotes ('). It can also be confusing what is the "beginning" of the string when mixing with hebrew because the bidirectionality may display it at the end even if the computer displays it at the beginning and vice versa.

See also https://www.w3.org/International/questions/qa-bidi-unicode-controls

182.232.193.236 (talkcontribs)

I should ask in Hebrew Wikipedia if they implemented rich text email and can explain what to do.

49.230.195.186 (talkcontribs)

@Bawolff

I understand that Hebrew Wikipedia doesn't have any contact forms besides the core Special:EmailUser; they actually refer users who wish to contact them formally to direct email addresses of the Israeli branch of WikiMedia Foundation, which according to What CMS dot org, uses WordPress.

I have tried to search data about my problem and found nothing.

I think that I would prefer Rich text email but as I am not a PHP programmer I don't know how to start to implement it. I ask for some graceful hints what to do as I might understand it from my little JavaScript knowledge.

49.230.195.186 (talkcontribs)

I have tried to search data about my problem and found nothing. => I have tried to search data about how to add rich text to my ContactPage emails and found nothing.*

Reply to "How to make ContactPage "message body" output RTL?"