43 'be-x-old' =>
'be-tarask',
46 'zh-classical' =>
'lzh',
47 'zh-min-nan' =>
'nan',
64 return self::$deprecatedLanguageCodeMapping;
78 if ( isset( self::$deprecatedLanguageCodeMapping[
$code] ) ) {
79 return self::$deprecatedLanguageCodeMapping[
$code];
95 $codeSegment = explode(
'-',
$code );
97 foreach ( $codeSegment as $segNo => $seg ) {
99 if ( $segNo > 0 && strtolower( $codeSegment[( $segNo - 1 )] ) ==
'x' ) {
100 $codeBCP[$segNo] = strtolower( $seg );
102 } elseif ( ( strlen( $seg ) == 2 ) && ( $segNo > 0 ) ) {
103 $codeBCP[$segNo] = strtoupper( $seg );
105 } elseif ( ( strlen( $seg ) == 4 ) && ( $segNo > 0 ) ) {
106 $codeBCP[$segNo] = ucfirst( strtolower( $seg ) );
109 $codeBCP[$segNo] = strtolower( $seg );
112 $langCode = implode(
'-', $codeBCP );
Methods for dealing with language codes.
static array $deprecatedLanguageCodeMapping
Mapping of deprecated language codes that were used in previous versions of MediaWiki to up-to-date,...
static replaceDeprecatedCodes( $code)
Replace deprecated language codes that were used in previous versions of MediaWiki to up-to-date,...
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
static bcp47( $code)
Get the normalised IETF language tag See unit test for examples.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code