MediaWiki  1.30.0
LanguageCode Class Reference

Methods for dealing with language codes. More...

Static Public Member Functions

static getDeprecatedCodeMapping ()
 Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes. More...
 
static replaceDeprecatedCodes ( $code)
 Replace deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes. More...
 

Static Private Attributes

static array $deprecatedLanguageCodeMapping
 Mapping of deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes. More...
 

Detailed Description

Methods for dealing with language codes.

Todo:
Move some of the code-related static methods out of Language into this class
Since
1.29

Definition at line 29 of file LanguageCode.php.

Member Function Documentation

◆ getDeprecatedCodeMapping()

static LanguageCode::getDeprecatedCodeMapping ( )
static

Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes.

This array is merged into $wgDummyLanguageCodes in Setup.php, along with the fake language codes 'qqq' and 'qqx', which are used internally by MediaWiki's localisation system.

Returns
string[]
Since
1.29

Definition at line 63 of file LanguageCode.php.

References $deprecatedLanguageCodeMapping.

Referenced by WebInstallerLanguage\getLanguageSelector(), and LanguageCodeTest\testGetDeprecatedCodeMapping().

◆ replaceDeprecatedCodes()

static LanguageCode::replaceDeprecatedCodes (   $code)
static

Replace deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes.

Other values will returned unchanged.

Parameters
string$codeOld language code
Returns
string New language code
Since
1.30

Definition at line 77 of file LanguageCode.php.

References $code.

Referenced by LanguageCodeTest\testReplaceDeprecatedCodes().

Member Data Documentation

◆ $deprecatedLanguageCodeMapping

array LanguageCode::$deprecatedLanguageCodeMapping
staticprivate
Initial value:
= [
'als' => 'gsw',
'bat-smg' => 'sgs',
'be-x-old' => 'be-tarask',
'fiu-vro' => 'vro',
'roa-rup' => 'rup',
'zh-classical' => 'lzh',
'zh-min-nan' => 'nan',
'zh-yue' => 'yue',
]

Mapping of deprecated language codes that were used in previous versions of MediaWiki to up-to-date, current language codes.

Mapping from language code to language code

Since
1.30

Definition at line 38 of file LanguageCode.php.

Referenced by getDeprecatedCodeMapping().


The documentation for this class was generated from the following file: