|
MediaWiki master
|
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information. More...
Public Member Functions | |
| __construct (ServiceOptions $options, NamespaceInfo $namespaceInfo, LocalisationCache $localisationCache, LanguageNameUtils $langNameUtils, LanguageFallback $langFallback, LanguageConverterFactory $langConverterFactory, HookContainer $hookContainer, Config $config) | |
| getLanguage ( $code) | |
| Get a cached or new language object for a given language code with normalization of the language code. | |
| getLanguageCode (string $code) | |
| 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). | |
| getRawLanguage ( $code) | |
| Get a cached or new language object for a given language code without normalization of the language code. | |
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information.
Definition at line 26 of file LanguageFactory.php.
| MediaWiki\Language\LanguageFactory::__construct | ( | ServiceOptions | $options, |
| NamespaceInfo | $namespaceInfo, | ||
| LocalisationCache | $localisationCache, | ||
| LanguageNameUtils | $langNameUtils, | ||
| LanguageFallback | $langFallback, | ||
| LanguageConverterFactory | $langConverterFactory, | ||
| HookContainer | $hookContainer, | ||
| Config | $config ) |
| ServiceOptions | $options | |
| NamespaceInfo | $namespaceInfo | |
| LocalisationCache | $localisationCache | |
| LanguageNameUtils | $langNameUtils | |
| LanguageFallback | $langFallback | |
| LanguageConverterFactory | $langConverterFactory | |
| HookContainer | $hookContainer | |
| Config | $config |
Definition at line 77 of file LanguageFactory.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
| MediaWiki\Language\LanguageFactory::getLanguage | ( | $code | ) |
Get a cached or new language object for a given language code with normalization of the language code.
If the language code comes from user input, check LanguageNameUtils::isValidCode() before calling this method.
The language code is presumed to be a MediaWiki-internal code, unless you pass a Bcp47Code opaque object, in which case it is presumed to be a standard BCP-47 code. (There are, regrettably, some ambiguous codes where this makes a difference.)
As the Language class itself implements Bcp47Code, this method is an efficient and safe downcast if you pass in a Language object.
| string | Bcp47Code | $code |
Definition at line 121 of file LanguageFactory.php.
| MediaWiki\Language\LanguageFactory::getLanguageCode | ( | string | $code | ) |
Definition at line 137 of file LanguageFactory.php.
| MediaWiki\Language\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).
| string | Bcp47Code | $code | The language to convert to; can be an internal MediaWiki language code or a Bcp47Code object (which includes Language, which implements Bcp47Code). |
Definition at line 241 of file LanguageFactory.php.
| MediaWiki\Language\LanguageFactory::getRawLanguage | ( | $code | ) |
Get a cached or new language object for a given language code without normalization of the language code.
If the language code comes from user input, check LanguageNameUtils::isValidCode() before calling this method.
| string | $code |
Definition at line 156 of file LanguageFactory.php.
| const MediaWiki\Language\LanguageFactory::CONSTRUCTOR_OPTIONS |
Definition at line 60 of file LanguageFactory.php.