MediaWiki master
MediaWiki\Parser\Parsoid\LanguageVariantConverter Class Reference

Public Member Functions

 __construct (private readonly OutputTransformPipeline $languageConverterPipeline, private readonly LanguageFactory $languageFactory, private readonly SiteConfig $siteConfig, TitleFactory $titleFactory, private readonly PageIdentity $pageIdentity,)
 
 convertPageBundleVariant (HtmlPageBundle $pageBundle, Bcp47Code $targetVariant, ?Bcp47Code $sourceVariant=null)
 Perform variant conversion on a HtmlPageBundle object.
 
 convertParserOutputVariant (ParserOutput $parserOutput, Bcp47Code $targetVariant, ?Bcp47Code $sourceVariant=null)
 Perform variant conversion on a ParserOutput object.
 
 setPageLanguageOverride (Bcp47Code $language)
 Set the page content language override.
 

Detailed Description

Since
1.40
Stability: unstable
should be marked stable before 1.40 release

Definition at line 23 of file LanguageVariantConverter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::__construct ( private readonly OutputTransformPipeline $languageConverterPipeline,
private readonly LanguageFactory $languageFactory,
private readonly SiteConfig $siteConfig,
TitleFactory $titleFactory,
private readonly PageIdentity $pageIdentity )

Member Function Documentation

◆ convertPageBundleVariant()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::convertPageBundleVariant ( HtmlPageBundle $pageBundle,
Bcp47Code $targetVariant,
?Bcp47Code $sourceVariant = null )

Perform variant conversion on a HtmlPageBundle object.

Parameters
HtmlPageBundle$pageBundle
Bcp47Code$targetVariant
?Bcp47Code$sourceVariant
Returns
HtmlPageBundle The converted HtmlPageBundle, or the object passed in as $pageBundle if the conversion is not supported.
Exceptions
HttpException

Definition at line 66 of file LanguageVariantConverter.php.

◆ convertParserOutputVariant()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::convertParserOutputVariant ( ParserOutput $parserOutput,
Bcp47Code $targetVariant,
?Bcp47Code $sourceVariant = null )

Perform variant conversion on a ParserOutput object.

Parameters
ParserOutput$parserOutput
Bcp47Code$targetVariant
?Bcp47Code$sourceVariant
Returns
ParserOutput

Definition at line 94 of file LanguageVariantConverter.php.

◆ setPageLanguageOverride()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::setPageLanguageOverride ( Bcp47Code $language)

Set the page content language override.

Parameters
Bcp47Code$language
Returns
void

Definition at line 49 of file LanguageVariantConverter.php.


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