MediaWiki REL1_37
MessageFormatterFactory.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Message;
4
5use Message;
8
13
15 private $format;
16
18 private $textFormatters = [];
19
27 public function __construct( string $format = Message::FORMAT_TEXT ) {
28 $this->format = $format;
29 }
30
34 public function getTextFormatter( $langCode ): ITextFormatter {
35 if ( !isset( $this->textFormatters[$langCode] ) ) {
36 $this->textFormatters[$langCode] = new TextFormatter(
37 $langCode, new Converter(), $this->format );
38 }
39 return $this->textFormatters[$langCode];
40 }
41}
if(ini_get('mbstring.func_overload')) if(!defined('MW_ENTRY_POINT'))
Pre-config setup: Before loading LocalSettings.php.
Definition Setup.php:88
Converter between Message and MessageValue.
Definition Converter.php:18
The MediaWiki-specific implementation of IMessageFormatterFactory.
getTextFormatter( $langCode)
Get a text message formatter for a given language.ITextFormatter
__construct(string $format=Message::FORMAT_TEXT)
Required parameters may be added to this function without deprecation.
The MediaWiki-specific implementation of ITextFormatter.
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:138
const FORMAT_TEXT
Transform {{..}} constructs but don't transform to HTML.
Definition Message.php:146
A simple factory providing a message formatter for a given language code.