Digging into a typical skin and seeing an innocent-looking call to `$this->msg()` leads to a rather unexpected alternate call graph.
* `class VectorTemplate extends BaseTemplate`: Calls `$this->msg()`
** `BaseTemplate::msg` calls `BaseTemplate::getMsg`
*** `BaseTemplate::getMsg` calls `$this->getSkin()->msg()`
This looks quite reasonable. But `BaseTemplate::msg` is actually an override of the parent class `QuickTemplate` for which the implementation is different, involving a seemingly unused and ancient class called `MediaWikiI18N`.
* QuickTemplate constructs `MediaWikiI18N` and stores as `$this->translator`
* QuickTemplate::msg calls $this->translator->translate
* `MediaWikiI18N::translate` performs `preg_replace` on the value, and then calls `wfMessage()`, then performs a while loop to perform `$N` replacements based on a locally stored data set.
* Along the way, it mentions various things about PHPTAL, which it was used for to migrate from, in **2004**.
It'd be good to figure out the plan to remove this ancient wrapper class. It seems `QuickTemplate` already has its own `getSkin`, so it seems like the easiest way would be to move `msg()` from BaseTemplate to QuickTemplate.
On the other hand, their signatures are not at all compatible, so a better way would be perhaps to remove it from QuickTemplate without replacement. And require any existing callers to either call wfMessage directly, or extend BaseTemplate instead to use `msg()`.
All skins currently deployed at Wikimedia use `BaseTemplate` and not the underlying `QuickTemplate`. But, [codesearch](https://codesearch.wmflabs.org/search/?q=extends%20QuickTemplate&i=nope&files=&repos=) reveals a few uses still:
* Collection: CollectionFailedTemplate, CollectionFinished[ ] Challenge: ChallengeUserTemplate, ..
* EditAccount: EditAccountCloseAccount[ ] Collection: CollectionFailedTemplate, EditAccountDisplayUserCollectionFinishedTemplate, ..
* TopLists: TopList[ ] EditAccount: EditAccountCloseAccountTemplate, EditorUIAccountDisplayUserTemplate, ..
* Blackout (skin): SopaStrikeTemplate, StopSopa[ ] MediaWikiChat: SpecialChatTemplate
* Challenge: ChallengeUser[ ] PollNY: CreatePollTemplate
* DumpHTML (skin): SkinOffline[ ] SpamRegex: SpamRegexUITemplate
* PollNY: CreatePoll[ ] TopLists: TopListEditorUITemplate, ..
* SpamRegex: SpamRegexUI[x] Blackout (skin): SopaStrikeTemplate, StopSopaTemplatee: 21c60791d98452fa2385662ac948e754f89b371b
* MinervaNeue[ ] DumpHTML (skin): phpunit/testSkinOfflineTemplate
* MediaWikiChat: SpecialChatTemplate[ ] MinervaNeue (skin): phpunit/test
Looks like almost all of these are actually not skin templates, but fragments for pieces used by extension output. These should probably be converted to Mustache HTML templates instead.