* @since 1.21
*/
public static function isSupportedLanguage( $code ) {
- return self::isValidBuiltInCode( $code )
- && ( is_readable( self::getMessagesFileName( $code ) )
- || is_readable( self::getJsonMessagesFileName( $code ) )
- );
+ if ( !self::isValidBuiltInCode( $code ) ) {
+ return false;
+ }
+
+ if ( $code === 'qqq' ) {
+ return false;
+ }
+
+ return is_readable( self::getMessagesFileName( $code ) ) ||
+ is_readable( self::getJsonMessagesFileName( $code ) );
}
/**
}
/**
- * A convenience function that returns the same thing as
- * getNamespaces() except with the array values changed to ' '
- * where it found '_', useful for producing output to be displayed
- * e.g. in <select> forms.
+ * A convenience function that returns getNamespaces() with spaces instead of underscores
+ * in values. Useful for producing output to be displayed e.g. in `<select>` forms.
*
* @return array
*/
/**
* Get a namespace value by key
+ *
* <code>
* $mw_ns = $wgContLang->getNsText( NS_MEDIAWIKI );
* echo $mw_ns; // prints 'MediaWiki'
*/
function getNsText( $index ) {
$ns = $this->getNamespaces();
-
return isset( $ns[$index] ) ? $ns[$index] : false;
}
*/
function getFormattedNsText( $index ) {
$ns = $this->getNsText( $index );
-
return strtr( $ns, '_', ' ' );
}