As is well known, we're still a bit inconsistent and confusing about what format various localized messages come in.
Some are to be formatted as plain text; some as wiki text; some as raw HTML. Some are plain text, but get wiki constructs tossed in as a preprocess step to support the plural-alternate function.
But what we do know is that things get ugly when messages *change* format -- customized messages in use on live sites break.
One that's been changed back and forth several times lately has been 'linkstoimage', used in the file links section on Image: description pages.
English Wikipedia uses a customized <div> wrapper with an id in there: http://en.wikipedia.org/wiki/MediaWiki:Linkstoimage
but it's been broken several times on the assumption that the message should be output as plaintext because the default text has no markup in it.
The most recent breakage was in r36139, changing it from wikitext to plaintext with wikitext preprocessing, apparently in order to support {{PLURAL}}.... which shouldn't even be necessary at all; it should work fine with $wgOut->addWikiMsg as is! :)
The change caused the "<div>" tag to be literally displayed in page output as plain text.
I've reverted the change temporarily so things will work as before until a proper update to the message and the message calls can be done.
At a minimum, one should check what format is really being used by the current code. When considering changing it, doing a quick survey of existing usage is strongly recommended. Wikipedians are notorious for using software facilities in ways we didn't expect! ;)
If it's *really* necessary to change formats in a way that could likely break (for instance, from HTML to wikitext or plaintext, or wikitext to plaintext, etc), the message key name should be changed. This prevents incompatible customizations from being incorrectly displayed.
The same goes when changing parameters or the places a message gets used; if the old version or a reasonably customized version of it doesn't make sense in the new system, it has to be changed.
In this case, the message doesn't need to change format in order to gain the extra capability (this is already built in to the wikitext display) and the extra parameters used for the {{PLURAL:}} won't have any negative effect on an old customized version in wikitext, so it doesn't need to be renamed as long as the code retains the format.
-- brion
Brion Vibber schrieb:
The most recent breakage was in r36139, changing it from wikitext to plaintext with wikitext preprocessing, apparently in order to support {{PLURAL}}.... which shouldn't even be necessary at all; it should work fine with $wgOut->addWikiMsg as is! :)
The request to support {{PLURAL}} comes from Betawiki for the possibility of proper localizations. $wgOut->addWikiText does the job now w/o breaking customizations.
At a minimum, one should check what format is really being used by the current code. When considering changing it, doing a quick survey of existing usage is strongly recommended. Wikipedians are notorious for using software facilities in ways we didn't expect! ;)
I missed to check existing usage, my apologies.
In this case, the message doesn't need to change format in order to gain the extra capability (this is already built in to the wikitext display) and the extra parameters used for the {{PLURAL:}} won't have any negative effect on an old customized version in wikitext, so it doesn't need to be renamed as long as the code retains the format.
The message names are unchanged, the new parameter with PLURAL doesn't hurt the existing customizations.
Raymond.
wikitech-l@lists.wikimedia.org