I feel some things are seriously wrong with this approach:
- The Title::getFullText() method I'm using does not always return the
canonical English namespace, but a localized one, depending on the users
language. This would be wrong. Unfortunately I was not able to create a
test case for this, nor did I found a way to make sure the returned
string is guaranteed to be a canonical one.
- The way I need to create a MediaWikiTitleCodec feels messy and wrong.
We don't care about almost everything the parser does, only about
namespaces, and typically only if the link does not contain additional
interwiki prefixes. There should be a more lightweight way to extract
the namespace from a title text.