MediaWiki  master
MediaWiki\Languages\LanguageFactory Class Reference

Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information. More...

Collaboration diagram for MediaWiki\Languages\LanguageFactory:

Public Member Functions

 __construct (ServiceOptions $options, LocalisationCache $localisationCache, LanguageNameUtils $langNameUtils, LanguageFallback $langFallback, LanguageConverterFactory $langConverterFactory)
 
 getLanguage ( $code)
 Get a cached or new language object for a given language code. More...
 
 getParentLanguage ( $code)
 Get the "parent" language which has a converter to convert a "compatible" language (in another variant) to this language (eg. More...
 

Private Member Functions

 classFromCode ( $code, $fallback=true)
 
 newFromCode ( $code, $fallback=false)
 Create a language object for a given language code. More...
 

Private Attributes

LanguageConverterFactory $langConverterFactory
 
LanguageFallback $langFallback
 
LanguageNameUtils $langNameUtils
 
array $langObjCache = []
 
LocalisationCache $localisationCache
 
ServiceOptions $options
 
array $parentLangCache = []
 

Detailed Description

Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information.

Since
1.35

Definition at line 41 of file LanguageFactory.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ classFromCode()

MediaWiki\Languages\LanguageFactory::classFromCode (   $code,
  $fallback = true 
)
private
Parameters
string$code
bool$fallbackWhether we're going through language fallback chain
Returns
string Name of the language class

Definition at line 184 of file LanguageFactory.php.

References $fallback.

Referenced by MediaWiki\Languages\LanguageFactory\newFromCode().

◆ getLanguage()

MediaWiki\Languages\LanguageFactory::getLanguage (   $code)

◆ getParentLanguage()

MediaWiki\Languages\LanguageFactory::getParentLanguage (   $code)

Get the "parent" language which has a converter to convert a "compatible" language (in another variant) to this language (eg.

zh for zh-cn, but not en for en-gb).

Parameters
string$code
Returns
Language|null
Since
1.22

Definition at line 200 of file LanguageFactory.php.

References $lang, and MediaWiki\Languages\LanguageFactory\getLanguage().

◆ newFromCode()

MediaWiki\Languages\LanguageFactory::newFromCode (   $code,
  $fallback = false 
)
private

Member Data Documentation

◆ $langConverterFactory

LanguageConverterFactory MediaWiki\Languages\LanguageFactory::$langConverterFactory
private

◆ $langFallback

LanguageFallback MediaWiki\Languages\LanguageFactory::$langFallback
private

◆ $langNameUtils

LanguageNameUtils MediaWiki\Languages\LanguageFactory::$langNameUtils
private

◆ $langObjCache

array MediaWiki\Languages\LanguageFactory::$langObjCache = []
private

Definition at line 58 of file LanguageFactory.php.

Referenced by MediaWiki\Languages\LanguageFactory\getLanguage().

◆ $localisationCache

LocalisationCache MediaWiki\Languages\LanguageFactory::$localisationCache
private

◆ $options

ServiceOptions MediaWiki\Languages\LanguageFactory::$options
private

Definition at line 43 of file LanguageFactory.php.

Referenced by MediaWiki\Languages\LanguageFactory\__construct().

◆ $parentLangCache

array MediaWiki\Languages\LanguageFactory::$parentLangCache = []
private

Definition at line 61 of file LanguageFactory.php.


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