Background: http://www.mediawiki.org/wiki/Localisation#Messages_quoting_each_other
I have the following message in an i18n file:
'ethereditor-warn-others' => 'Warning: Some other users are currently editing this page in a collaborative session using the EtherEditor extension. While you are welcome to keep editing here, their changes may conflict with yours. Please consider clicking the "{{int:ethereditor-collaborate-button}}" button in the top right of the page screen to join them, and avoid merge conflicts.'
This is a great thing and all, since I don't want people to need to update this message if the ethereditor-collaborate-button message gets changed. OK, good stuff.
However, the JavaScript message object has two huge problems with this:
- The JS message object doesn't even glance at the {{int:....}} part, just leaves it.
- Even if it did look at it, I never included 'ethereditor-collaborate-button' in the required messages for this module, so there would be exactly no way for the library to sanely handle the int-hack method.
So, possible solutions:
- Compile the int-hack bits of the message on the server before it gets sent to the client. This isn't ideal, since the client couldn't modify the message if necessary (for example, I use a message in the same extension to generate a regular expression).
- Auto-include the int-hacked messages (in this case, ethereditor-collaborate-button) in the resource loader's loaded messages, and then consider {{int:}} parts of a message while parsing. This would take some doing, but it's possible. Also, a potential problem (and this is perhaps a consideration for the entire l10n system, not just client-side) is that {{int}} is a valid template on some wikis. I'm not sure if that's important, maybe if the parser looks for {{int:<something>}}, there won't be overlap with {{int|something}}.
T49840: Add parameter support to int: magic word in jQueryMsg (merged into this) is adding parameters (part of the PHP parser's int functionality). E.g. {{int:editsectionhint|MediaWiki}} from https://www.mediawiki.org/wiki/Help:Magic_words#Localization
Version: 1.20.x
Severity: enhancement