Page MenuHomePhabricator

Advanced Search help messages should use wiki syntax instead of HTML
Closed, ResolvedPublic

Description

Maybe there's a reason why the help messages use HTML instead of wiki syntax, but I really think they should be changed, as translating them is much more difficult (and it's easier to make errors).

Example: The message MediaWiki:Advancedsearch-help-not is currently:

<dl><dt>Description:</dt><dd>Excludes pages containing these words from the search.</dd> <dt>Be aware of the following: </dt><dd><ul> <li>Word stemming is applied. Example: If <em>car</em> is entered, the search will also consider <em>cars</em>. The word stemming is language specific.</li> </ul></dd> <dt>Help page:</dt><dd>[https://www.mediawiki.org/wiki/Help:CirrusSearch#Words.2C_phrases.2C_and_modifiers Words, phrases, and modifiers]</dd> <dt>Syntax-Equivalent in the normal search:</dt><dd>Words with <code>-</code> before them, for example <code>-elephant</code>.</dd></dl>

This should instead be written:

;Description
:Excludes pages containing these words from the search.
;Be aware of the following
:*Word stemming is applied. Example: If ''car'' is entered, the search will also consider ''cars''. The word stemming is language specific.
;Help page
:[https://www.mediawiki.org/wiki/Help:CirrusSearch#Words.2C_phrases.2C_and_modifiers Words, phrases and modifiers]
;Syntax-Equivalent in the normal search
:Words with <code>-</code> before them, for example <code>-elephant</code>.

Much more readable and digestible for translators.

(Note that this omits the trailing colons on each header line, because those don't show up properly with wiki syntax, but they're not really necessary anyways.)

Event Timeline

jhsoby created this task.Nov 25 2017, 10:59 AM
Restricted Application added a project: TCB-Team. · View Herald TranscriptNov 25 2017, 10:59 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
jhsoby moved this task from Incoming to Advanced Search on the TCB-Team board.Nov 25 2017, 10:59 AM
Restricted Application added a project: User-Jayprakash12345. · View Herald TranscriptNov 25 2017, 1:16 PM
Jayprakash12345 removed Jayprakash12345 as the assignee of this task.Nov 25 2017, 1:22 PM
Jayprakash12345 added a subscriber: Jayprakash12345.

I am handle only single line till now. Sorry

I could make the actual change in the messsages myself, but I know from experience that in some cases, messages don't accept wikitext. But when I think about it, these messages do use wikitext format for the links, so wikitext has to be fine for the rest too. What do you think, @Lea_WMDE, should I make and commit the change?

I am fine with this if that's the standard way to do it. Is it defined anywhere in the OOUi-element PopupButtonWidget how the syntax should look?

In vektor and monobook it looks fine to me with wikitext except for the line break. Will that happen anyway or will the help box become huge?

in timeless it doesn't look as intended though since ; is handles very differently it seems. I'm assuming that would not happen with html, is that correct?

The wikitext produces exactly the same code as the HTML, so any differences in the output of the wikitext would also be present with HTML.

@jhsoby thanks for you answer.

the cases where some messages don't accept wikitext. Can we test for that or make sure it doesn't happen or there is a fallback in case it does happen? If that is not an issue I would give a go on the change.

@Lea_WMDE do you agree?

@Charlie_WMDE Sure, all you would need to do to test it is to change one of the messages locally on a wiki that has the extension. Embarassingly though, I haven't been able to find where they're actually used (which special page?), if not I could test it myself easily enough.

@jhsoby thanks for bringing this to our attention and offering to put a patch up! If wikitext makes it easier to translate, please do change it!
But just to be on the safe side (and learning more about the rules of translation):
@siebrand would you agree

  • that in the specific use case of the advanced search helptext wikitext would be an improvement over the current html messages?
  • that in general we should avoid html and use wikitext in translation messages instead?
  • Do you know where wikitext in translation messages is not allowed?

@siebrand would you agree

  • that in the specific use case of the advanced search helptext wikitext would be an improvement over the current html messages?

I think that raw HTML should be prevented whenever possible.

  • that in general we should avoid html and use wikitext in translation messages instead?

See above ;).

  • Do you know where wikitext in translation messages is not allowed?

That depends on the processing of the input with wfMessage(), so there's no rule of thumb for it. You can find details at https://www.mediawiki.org/wiki/Manual:Messages_API#Output_modes_and_escaping.

@siebrand thanks!
@jhsoby patches will be appreciated :)

Change 394039 had a related patch set uploaded (by Jon Harald Søby; owner: Jon Harald Søby):
[mediawiki/extensions/AdvancedSearch@master] Use wikitext instead of HTML

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

jhsoby claimed this task.Nov 29 2017, 11:11 AM

Change 394039 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Use wikitext instead of HTML

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

Patch looks good, thanks :-). Issues with timeless skin are independent from the change to Wikitext and seem to be style related.

@Charlie_WMDE if you find anything disturbing with the timeless skin, please file a ticket :-)

jhsoby closed this task as Resolved.Nov 30 2017, 2:05 PM
WMDE-Fisch moved this task from Proposed to Done on the WMDE-QWERTY-Team board.Nov 30 2017, 3:17 PM
Lea_WMDE removed a subscriber: Lea_WMDE.
Lea_WMDE added a subscriber: Lea_WMDE.
Lea_WMDE moved this task from Done to Demoed on the WMDE-QWERTY-Team board.Feb 20 2018, 3:33 PM