Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\PageTranslation\ParserOutput Class Reference

Represents a parsing output produced by TranslatablePageParser. More...

Public Member Functions

 __construct (string $template, array $sectionMap, array $unitMap)
 
 sourcePageTemplate ()
 Returns template that contains <translate> tags.
 
 translationPageTemplate ()
 Returns template that does not contain <translate> tags.
 
 units ()
 
 sourcePageTextForRendering (Language $sourceLanguage)
 Returns the source page wikitext used for rendering the page.
 
 sourcePageTextForSaving ()
 Returns the source page with translation unit markers.
 
 sourcePageTemplateForDiffs ()
 Returns the page text with translation tags and unit placeholders for easy diffs.
 

Detailed Description

Represents a parsing output produced by TranslatablePageParser.

It is required generate translatable and translation page sources or just get the list of translations units.

Author
Niklas Laxström @license GPL-2.0-or-later
Since
2020.08

Definition at line 19 of file ParserOutput.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::__construct ( string $template,
array $sectionMap,
array $unitMap )

Definition at line 27 of file ParserOutput.php.

Member Function Documentation

◆ sourcePageTemplate()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::sourcePageTemplate ( )

Returns template that contains <translate> tags.

Definition at line 37 of file ParserOutput.php.

◆ sourcePageTemplateForDiffs()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::sourcePageTemplateForDiffs ( )

Returns the page text with translation tags and unit placeholders for easy diffs.

Definition at line 85 of file ParserOutput.php.

◆ sourcePageTextForRendering()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::sourcePageTextForRendering ( Language $sourceLanguage)

Returns the source page wikitext used for rendering the page.

Definition at line 62 of file ParserOutput.php.

◆ sourcePageTextForSaving()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::sourcePageTextForSaving ( )

Returns the source page with translation unit markers.

Definition at line 74 of file ParserOutput.php.

◆ translationPageTemplate()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::translationPageTemplate ( )

Returns template that does not contain <translate> tags.

Definition at line 47 of file ParserOutput.php.

◆ units()

MediaWiki\Extension\Translate\PageTranslation\ParserOutput::units ( )
Returns
TranslationUnit[]

Definition at line 57 of file ParserOutput.php.


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