MediaWiki master
MediaWiki\Language\MessageParser Class Reference

Service for transformation of interface message text. More...

Public Member Functions

 __construct (ParserFactory $parserFactory, OutputTransformPipeline $outputPipeline, LanguageFactory $languageFactory, LoggerInterface $logger)
 
 parse (string $text, ?PageReference $contextPage=null, bool $lineStart=true, bool $interface=false, $language=null)
 
 parseWithoutPostprocessing ( $text, ?PageReference $page=null, $lineStart=true, $interface=false, $language=null)
 
 transform ( $message, $interface=false, $language=null, ?PageReference $page=null)
 Run message text through the preprocessor, expanding parser functions.
 

Detailed Description

Service for transformation of interface message text.

Since
1.44

Definition at line 25 of file MessageParser.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Language\MessageParser::__construct ( ParserFactory $parserFactory,
OutputTransformPipeline $outputPipeline,
LanguageFactory $languageFactory,
LoggerInterface $logger )

Definition at line 48 of file MessageParser.php.

Member Function Documentation

◆ parse()

MediaWiki\Language\MessageParser::parse ( string $text,
?PageReference $contextPage = null,
bool $lineStart = true,
bool $interface = false,
$language = null )
Parameters
string$text
?PageReference$contextPageThe context page, or null to use a placeholder
bool$lineStartWhether this should be parsed in start-of-line context
bool$interfaceWhether this is an interface message
Language | StubUserLang | string | null$languageLanguage for {{PLURAL:}} etc., or null for the user or content language depending on $interface
Returns
ParserOutput

Definition at line 105 of file MessageParser.php.

◆ parseWithoutPostprocessing()

MediaWiki\Language\MessageParser::parseWithoutPostprocessing ( $text,
?PageReference $page = null,
$lineStart = true,
$interface = false,
$language = null )
Parameters
string$text
?PageReference$pageThe context title, or null to use a placeholder
bool$lineStartWhether this is at the start of a line
bool$interfaceWhether this is an interface message
Language | StubUserLang | string | null$languageTarget language
Returns
ParserOutput

Definition at line 146 of file MessageParser.php.

◆ transform()

MediaWiki\Language\MessageParser::transform ( $message,
$interface = false,
$language = null,
?PageReference $page = null )

Run message text through the preprocessor, expanding parser functions.

Parameters
string$message
bool$interface
Language | string | null$languageLanguage for {{PLURAL:}} etc., or null for the user or content language depending on $interface
PageReference | null$page
Returns
string

Definition at line 70 of file MessageParser.php.


The documentation for this class was generated from the following file: