Page MenuHomePhabricator

"Search within pages" message is always in content language
Closed, ResolvedPublic

Description

The MobileFrontend's search functionality displays the mobile-frontend-search-content-no-results message (currently set to '''{{int:mobile-frontend-search-content}}''' to see if this phrase appears anywhere.), using an embedded {{int:mobile-frontend-search-content}} to insert a bolded Search within pages phrase.

However, the construction (together with the message definition) causes the embedded {{int:}} to use the content language of the wiki instead of the user's UI language like the rest of the message. That means the users sees a bilingual mixed message whenever she uses a different UI language than the wiki content language.

For instance: go to https://cs.m.wikipedia.org/wiki/X?uselang=en and write some nonsense to the search box. You'll get "No page with this title. Hledat v obsahu stránek to see if this phrase appears anywhere." with a Czech translation of the subphrase within the English message. (Or vice versa: go to https://en.m.wikipedia.org/wiki/X?uselang=cs and write some nonsense there, and you'll get "Neexistuje žádná stránka s tímto názvem. Search within pages, zda se tento text někde neobjevuje.")

This bug have probably been reported already at T74985, which is now Closed, Invalid. Not sure if something changed since then or not, but this is definitely a bug, so the resolution does not make much sense to me.

Developer notes

Some screenshots illustrate the problem:

Screen Shot 2018-07-09 at 2.37.38 PM.png (245×848 px, 40 KB)

Screen Shot 2018-07-09 at 2.36.54 PM.png (251×762 px, 37 KB)

Event Timeline

Mormegil created this task.

Change 433082 had a related patch set uploaded (by Mormegil; owner: Mormegil):
[mediawiki/extensions/MobileFrontend@master] Fix parsing/i18n of no-results message

https://gerrit.wikimedia.org/r/433082

Jdlrobson raised the priority of this task from Low to Medium.Jul 9 2018, 9:39 PM
Jdlrobson updated the task description. (Show Details)

Thanks @Mormegil for taking the time to explain this. I understand this now and have merged your patch. I've added to our sprint board to make sure this also gets reviewed by our designer and goes through some testing.

@alexhollender let me know if the description is not clear. You can test this on http://reading-web-staging.wmflabs.org/wiki/Main_Page?uselang=es#/search

Change 433082 merged by Jdlrobson:
[mediawiki/extensions/MobileFrontend@master] Fix parsing/i18n of no-results message

https://gerrit.wikimedia.org/r/433082

This was merged Monday, July 9th and should be available for testing in prod. E.g., https://cs.m.wikipedia.org/wiki/X?uselang=en.

ovasileva subscribed.

all done here!

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptSep 13 2018, 6:39 PM