|
MediaWiki master
|
An implementation of LocalizationContext that implements only the methods defined in the interface.
More...
Inherits MediaWiki\Language\LocalizationContext.

Public Member Functions | |||||||
| __construct (private readonly MessageLocalizer $messageLocalizer, private readonly Bcp47Code $language,) | |||||||
| getLanguageCode () | |||||||
Returns the target language for UI localization.
| |||||||
| msg ( $key,... $params) | |||||||
This is the method for getting translated interface messages.
| |||||||
An implementation of LocalizationContext that implements only the methods defined in the interface.
Intended for use where you don't have access to a LocalizationContext but have access to a Bcp47Code and MessageLocalizer.
Callers should usually ensure the languages are the same for the Bcp47Code and the MessageLocalizer.
Definition at line 24 of file SimpleLocalizationContext.php.
| MediaWiki\Language\SimpleLocalizationContext::__construct | ( | private readonly MessageLocalizer | $messageLocalizer, |
| private readonly Bcp47Code | $language ) |
Definition at line 26 of file SimpleLocalizationContext.php.
| MediaWiki\Language\SimpleLocalizationContext::getLanguageCode | ( | ) |
Returns the target language for UI localization.
Implements MediaWiki\Language\LocalizationContext.
Definition at line 33 of file SimpleLocalizationContext.php.
| MediaWiki\Language\SimpleLocalizationContext::msg | ( | $key, | |
| $params ) |
This is the method for getting translated interface messages.
| string | string[] | MessageSpecifier | $key | Message key, or array of keys, or a MessageSpecifier. |
| MessageParam|MessageSpecifier|string|int|float|list<MessageParam|MessageSpecifier|string|int|float> | ...$params See Message::params() |
Implements MediaWiki\Language\MessageLocalizer.
Definition at line 38 of file SimpleLocalizationContext.php.