Page MenuHomeWickedGov Phorge

MessageFormatterFactory.php
No OneTemporary

Size
982 B
Referenced Files
None
Subscribers
None

MessageFormatterFactory.php

<?php
namespace MediaWiki\Message;
use Wikimedia\Message\IMessageFormatterFactory;
use Wikimedia\Message\ITextFormatter;
/**
* The MediaWiki-specific implementation of IMessageFormatterFactory
*
* To obtain an instance, use \MediaWiki\MediaWikiServices::getMessageFormatterFactory().
*
* @ingroup Language
*/
class MessageFormatterFactory implements IMessageFormatterFactory {
private string $format;
private array $textFormatters = [];
/**
* @internal For use by ServiceWiring only
* @param string $format which if the Message::FORMAT_* to use in the formatters.
*/
public function __construct( string $format = Message::FORMAT_TEXT ) {
$this->format = $format;
}
/**
* @inheritDoc
*/
public function getTextFormatter( string $langCode ): ITextFormatter {
if ( !isset( $this->textFormatters[$langCode] ) ) {
$this->textFormatters[$langCode] = new TextFormatter(
$langCode, $this->format );
}
return $this->textFormatters[$langCode];
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 4 2026, 08:12 (6 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
be/7f/a98227d6717abb2e70de5d74cce7
Default Alt Text
MessageFormatterFactory.php (982 B)

Event Timeline