* @return bool
*/
public static function isKnownLanguageTag( $tag ) {
- static $coreLanguageNames;
-
// Quick escape for invalid input to avoid exceptions down the line
// when code tries to process tags which are not valid at all.
if ( !self::isValidBuiltInCode( $tag ) ) {
return false;
}
- if ( $coreLanguageNames === null ) {
- global $IP;
- include "$IP/languages/Names.php";
- }
-
- if ( isset( $coreLanguageNames[$tag] )
+ if ( isset( MediaWiki\Languages\Data\Names::$names[$tag] )
|| self::fetchLanguageName( $tag, $tag ) !== ''
) {
return true;
*/
private static function fetchLanguageNamesUncached( $inLanguage = null, $include = 'mw' ) {
global $wgExtraLanguageNames;
- static $coreLanguageNames;
-
- if ( $coreLanguageNames === null ) {
- global $IP;
- include "$IP/languages/Names.php";
- }
// If passed an invalid language code to use, fallback to en
if ( $inLanguage !== null && !Language::isValidCode( $inLanguage ) ) {
Hooks::run( 'LanguageGetTranslatedLanguageNames', array( &$names, $inLanguage ) );
}
- $mwNames = $wgExtraLanguageNames + $coreLanguageNames;
+ $mwNames = $wgExtraLanguageNames + MediaWiki\Languages\Data\Names::$names;
foreach ( $mwNames as $mwCode => $mwName ) {
# - Prefer own MediaWiki native name when not using the hook
# - For other names just add if not added through the hook
return (bool)$this->mConverter->validateVariant( $variant );
}
- /**
- * Put custom tags (e.g. -{ }-) around math to prevent conversion
- *
- * @param string $text
- * @return string
- * @deprecated since 1.22 is no longer used
- */
- public function armourMath( $text ) {
- return $this->mConverter->armourMath( $text );
- }
-
/**
* Perform output conversion on a string, and encode for safe HTML output.
* @param string $text Text to be converted