- $text = $title->getNsText();
- if ( isset( $this->mNamespaceTables[$variant][$text] ) ) {
- $text = $this->mNamespaceTables[$variant][$text];
+ // first let's check if a message has given us a converted name
+ $nsConvKey = 'conversion-ns' . $index;
+ if ( !wfEmptyMsg( $nsConvKey ) ) {
+ $text = wfMsgForContentNoTrans( $nsConvKey );
+ } else {
+ // the message does not exist, try retrieve it from the current
+ // variant's namespace names.
+ $langObj = $this->mLangObj->factory( $variant );
+ $text = $langObj->getFormattedNsText( $index );