Carlb added a comment.
This is just an untested idea, but perhaps a more general solution would be
to str_replace the group name and (in the lone case where $group=='wikipedia')
also str_replace out the 'wiki' suffix. Something like:
public function getInterwikiCodeFromSite( Site
Carlb added a comment.
What happens if the group name doesn't start with "wiki* or "wiktionary".
That's pretty much an inevitability on a third-party wiki.
For instance, if Oncyclopedia is a Dutch-language Uncyclopedia, its $site
entry might look something like this: