return $this->mNamespaceIds;
}
-
/**
* Get a namespace key by value, case insensitive. Canonical namespace
* names override custom ones defined for the current language.
*/
function getNsIndex( $text ) {
$lctext = $this->lc( $text );
- if ( ( $ns = MWNamespace::getCanonicalIndex( $lctext ) ) !== null ) {
+ $ns = MWNamespace::getCanonicalIndex( $lctext );
+ if ( $ns !== null ) {
return $ns;
}
$ids = $this->getNamespaceIds();
list( $rootCode ) = explode( '-', $code );
if( $usemsg && wfMessage( $msg )->exists() ) {
return $this->getMessageFromDB( $msg );
- } elseif( $name = self::getLanguageName( $code ) ) {
+ }
+ $name = self::getLanguageName( $code );
+ if( $name ) {
return $name; # if it's defined as a language name, show that
} else {
# otherwise, output the language code