Page MenuHomePhabricator

Email notifications in Indian language wikis have excess newlines
Open, LowPublic

Description

I am Nasir, an active contributor of Bengali WIkipedia. I use the email notifications for the change on my watch list pages and it is also enabled for all the notifications. It is helpful to get the notifications as email but the emails are not formatted as it should. I faced the following issues for the Bengali emails and i think these should be fixed soon.

  • Sometimes a new line appeases between the words of a page name, and sometimes new line appears after 4/5 words in a sentence. I think we are using a fixed DIV width for these texts. If it will be removed then it may be fixed.
  • Unicode URLs are not readable at all. For the Bengali wiki urls we can make some changes to make the url more readable. like url format could be like this <a href="PAGE_LINK">http://bn.wikipedia.org/wiki/PAGE_NAME</a>

Version: 1.22.0
Severity: minor

Details

Reference
bz56063

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:28 AM
bzimport added projects: MediaWiki-Email, I18n.
bzimport set Reference to bz56063.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

  • Sometimes a new line appeases between the words of a page name, and

sometimes
new line appears after 4/5 words in a sentence. I think we are using a fixed
DIV width for these texts. If it will be removed then it may be fixed.

Attaching or pasting one such email would be helpful.

  • Unicode URLs are not readable at all. For the Bengali wiki urls we can make

some changes to make the url more readable. like url format could be like
this
<a href="PAGE_LINK">http://bn.wikipedia.org/wiki/PAGE_NAME</a>

HTML enotifs are done by [[mw:Echo]]; maybe ShortUrl could also be used in text enotifs, that should be another bug.

Created attachment 13552
Received email content format

Attached:

Created attachment 13553
Email content format (how it should be)

Attached:

Uploaded two attachments first one (Attachment 13552, Received email content format) is the screenshot of the received email and the second one (Attachment 13553, Email content format (how it should be)) shows how the email contents should be displayed.

Nasir Khan Saikat

I was not asking about the ShortUrl. The link we receive in the email are not hu PAGE_NAME are displayed properly in the email the email we
<a href="PAGE_LINK">http://bn.wikipedia.org/wiki/PAGE_NAME</a>

As written in comment 1, attaching one such example email (with header lines) would be very helpful (please make sure that no confidential data is included).

(In reply to comment #4)

Uploaded two attachments first one (Attachment 13552 [details], Received
email content
format) is the screenshot of the received email and the second one
(Attachment
13553 [details], Email content format (how it should be)) shows how the
email contents
should be displayed.

The URLs seem functional in both examples, so this bug seems to be about newlines in the non-URL text of the email notifications. How did you get Gmail to show the message correctly? How can we see it ourselves and how do we know it's a problem in MediaWiki?

On plain text and long URLs, see comment 1.

@Andre Klapper, are you asking me to export the original email content and attach that here?

@Nemo, If you open a Gmail email in print mode you can get the email texts in this format. First screenshot is the original message, i did nothing here, just captured the screenshot. And after opening the email in print mode i edited the source and took the second screenshot. The is a <br> (line break) after 3/4 wards in that source, i cleaned those and the texts look ok.

Yes, it is a problem of MediaWiki, because between the word of a page names (example উইকিপিডিয়া:প্রশাসকদের আলোচনাসভা) there is no way to add a line break. but i got these "উইকিপিডিয়া:প্রশাসকদের আলোচনাসভা" 3 words in 2 lines.

--Nasir Khan

Yes, full email content or export in .eml format would help: then everyone can open the email in Thunderbird. :)

Created attachment 13592
enotif from te.wiki

I remembered receiving some enotifs with weird newlines, so I retrieved one from te.wiki: the newlines are wrong there too, right?
(Again, for long URLs please file another report.)

Attached:

Created attachment 13594
Original Email Content bn.wiki

@Nemo, Yes the problem is similar as the te.wiki. There are some additional new line there. I have attached a copy of the bn.wiki email.
I do not know how to export as .eml form Gmail. Here i just attached the 'Original Contents' of that email. Please let me know if it is helpful or not.

Nasir Khan

Attached:

(In reply to comment #11)

@Nemo, Yes the problem is similar as the te.wiki. There are some additional
new
line there.

Ok great. Now that we've clarified the issue: Santhosh, do you know what may be causing this weird wrapping in plain text enotifs?

Is there any update in this bug?

Unfortunately not.

Somebody needs to investigate here what may be causing that weird wrapping in plain text enotifs...

Is there any update on this issue?

Is there any update on this issue?

MediaWiki email notifications are unmaintained, there are no updates in this component.

@Nemo_bis
so, what should be the proposed solution for this?

Silent patience, or pro-active work.

Likely caused this piece of code:

EmailNotification.php
395:            $this->body = wordwrap( strtr( $body, $postTransformKeys ), 72 );

wordwrap counts bytes and not characters.

Perhaps word wrapping is not needed, or unicode aware replacement needs to be created.

scfc added a subscriber: scfc.Mar 26 2015, 9:49 PM

@Nikerabbit is there any plan to implement HTML emails in core? then it might be easier to resolve this and present the text in a more formatted way.

None I am aware of.

@Nikerabbit is there any plan to implement HTML emails in core? then it might be easier to resolve this and present the text in a more formatted way.

Well. We had one project for that for last GSoC, which never ended up well. https://phabricator.wikimedia.org/T15303

I wonder if we should introduce an option for a maximum character length of enotif links. When links get longer than that, the &title parameter in URLs would be skipped and replaced by curid or oldid (of course that's not possible for the special pages).