Is it possible to override messages part of MediaWiki core via an extension. I tried adding to an extension's en.json file and that didn't seem to work, but am wondering if there's another way.
Is it possible for an extension to add a language? If so, then the extension's mylang.json file could only define those that need overriding and fallback on another language for everything else.
Thanks, James
On 2018-09-06 22:33, James Montalvo wrote:
Is it possible to override messages part of MediaWiki core via an extension. I tried adding to an extension's en.json file and that didn't seem to work, but am wondering if there's another way.
Yes, but it's a bit of a hack. You have to define a different message (under a different key/name), then use the 'MessageCache::get' hook [1] to make MediaWiki load your message instead of the original one. On Wikimedia wikis we use this in the WikimediaMessages extension to use a different wording for some messages [2].
[1] https://www.mediawiki.org/wiki/Manual:Hooks/MessageCache::get [2] https://phabricator.wikimedia.org/diffusion/EWME/browse/master/WikimediaMess...
Yeah but it's not pretty - take a look at the first function in https://github.com/wikimedia/mediawiki-extensions-WikimediaMessages/blob/mas...
On Thu, 6 Sep 2018, 21:34 James Montalvo, jamesmontalvo3@gmail.com wrote:
Is it possible to override messages part of MediaWiki core via an extension. I tried adding to an extension's en.json file and that didn't seem to work, but am wondering if there's another way.
wikitech-l@lists.wikimedia.org