Introduce NamespaceUnlocalizer

Authored by thiemowmde on May 7 2019, 4:07 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.


Introduce NamespaceUnlocalizer

I feel some things are seriously wrong with this approach:

  1. 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.

  1. 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.

Bug: T213821
Change-Id: I02b32a699fff8d4afb072506c6683f9fff9ed29d