3 namespace MediaWiki\Message
;
5 use Wikimedia\Message\IMessageFormatterFactory
;
6 use Wikimedia\Message\ITextFormatter
;
9 * The MediaWiki-specific implementation of IMessageFormatterFactory
11 class MessageFormatterFactory
implements IMessageFormatterFactory
{
12 private $textFormatters = [];
15 * Required parameters may be added to this function without deprecation.
16 * External callers should use MediaWikiServices::getMessageFormatterFactory().
20 public function __construct() {
23 public function getTextFormatter( $langCode ): ITextFormatter
{
24 if ( !isset( $this->textFormatters
[$langCode] ) ) {
25 $this->textFormatters
[$langCode] = new TextFormatter( $langCode );
27 return $this->textFormatters
[$langCode];