Ticket #317 (closed: fixed)

Opened 17 months ago

Last modified 16 months ago

Use addHTML() as seldom as possible, esp. with system messages

Reported by: heuler06 Owned by: jojo
Priority: normal Milestone:
Component: collection Severity:
Keywords: Cc:

Description

Wiki syntax is not recognized in system messages. That's why I suggest that the messages will be parsed by the mediawiki parser if possible. Otherwise you have to use HTML syntax in the messages.

Change History

  Changed 17 months ago by jojo

There are several strings in Collection.i18n.php that contain wikitext and are translated via wfMsg*() and then added to the OutputPage via addWikiText(). Others contain HTML (because of custom links with query parameters for example) and are translated via wfMsgHtml() and then added to the output via addHTML().

Maybe I didn't get it though: In this case what do you mean with "system messages"?

  Changed 17 months ago by heuler06

No, I think you got it right. I set a wiki link at MediaWiki:Coll-save collection text that wasn't a link on the special page. Maybe this message is not parsed now?

  Changed 17 months ago by jojo

Oh, ok, now I get you mean (I saw that you put some additional – most probably de.wikibooks.org-specific text – to the coll-save_collection_text message): This particular message is translated via wfMsgHtml() and then inserted to the special page (together other text) via addHTML() because the surrounding text contains a HTML <form> and is contained in some floating <div> element (the latter might be achievable with wikitext, but as far as I know, forms cannot be added via wikitext).

There are some more places in the extension code that use HTML text directly. If it's possible to replace these occurances (or at least minimize their amount) with pure wikitext, I'd be glad to do it because your use-case showed that it's preferable to have the parser always availableto allow better customization via changed system messages alone.

  Changed 17 months ago by jojo

  • summary changed from parse system messages to Use addHTML() as seldom as possible, esp. with system messages

follow-up: ↓ 6   Changed 16 months ago by jojo

Recently I refactored the code to make use of templates instead of putting lots of addHTML() calls in the main code. Do you think this ticket can be closed after this change?

in reply to: ↑ 5   Changed 16 months ago by heuler06

I don't know because I don't understand what you want to tell me. ;-)

If it is possible then to use Wiki ML it can be closed, of course. :) But if not it should not be closed. That's the only question for me.

  Changed 16 months ago by jojo

  • status changed from new to closed
  • resolution set to fixed

I  replaced some more translation calls, so that wikitext is supported.

I think the messages that are left and that don't support wikitext, cannot be changed, because it would lead to conflicts with the surrounding HTML (which we can't do without).

So I'll set this to fixed now. Feel free to reopen if there is e.g. a concrete example where wikitext would be desirable, but cannot be used.

Note: See TracTickets for help on using tickets.