MediaWiki REL1_35
|
An interface for creating language converters. More...
Public Member Functions | |
__construct ( $usePigLatinVariant, callable $defaultLanguage) | |
getLanguageConverter ( $language=null) | |
Provide a LanguageConverter for given language. | |
Private Member Functions | |
classFromCode (string $code) | |
Returns Converter's class name for given language code. | |
Private Attributes | |
$cache = [] | |
array | $converterClasses |
$defaultConverterClass = TrivialLanguageConverter::class | |
callable | $defaultLanguage |
callback of () : Language | |
An interface for creating language converters.
Definition at line 44 of file LanguageConverterFactory.php.
MediaWiki\Languages\LanguageConverterFactory::__construct | ( | $usePigLatinVariant, | |
callable | $defaultLanguage | ||
) |
bool | $usePigLatinVariant | should pig variant of English be used |
callable | $defaultLanguage | - callback of () : Language, should return default language. Used in getLanguageConverter when $language is null. |
Definition at line 77 of file LanguageConverterFactory.php.
References MediaWiki\Languages\LanguageConverterFactory\$defaultLanguage.
|
private |
Returns Converter's class name for given language code.
string | $code | code for which class name should be provided |
Definition at line 90 of file LanguageConverterFactory.php.
MediaWiki\Languages\LanguageConverterFactory::getLanguageConverter | ( | $language = null | ) |
Provide a LanguageConverter for given language.
Language | null | $language | for which a LanguageConverter should be provided. If null then LanguageConverter provided for current content language as returned by the callback provided to the constructor.. |
Definition at line 104 of file LanguageConverterFactory.php.
References $lang.
|
private |
Definition at line 46 of file LanguageConverterFactory.php.
|
private |
Definition at line 50 of file LanguageConverterFactory.php.
|
private |
Definition at line 63 of file LanguageConverterFactory.php.
|
private |
callback of () : Language
Definition at line 68 of file LanguageConverterFactory.php.
Referenced by MediaWiki\Languages\LanguageConverterFactory\__construct().