MediaWiki REL1_40
MediaWiki\Parser\Parsoid\LanguageVariantConverter Class Reference

Public Member Functions

 __construct (PageIdentity $pageIdentity, PageConfigFactory $pageConfigFactory, Parsoid $parsoid, array $parsoidSettings, SiteConfig $siteConfig, TitleFactory $titleFactory, LanguageConverterFactory $languageConverterFactory, LanguageFactory $languageFactory)
 
 convertPageBundleVariant (PageBundle $pageBundle, Bcp47Code $targetVariant, ?Bcp47Code $sourceVariant=null)
 Perform variant conversion on a PageBundle object.
 
 convertParserOutputVariant (ParserOutput $parserOutput, Bcp47Code $targetVariant, ?Bcp47Code $sourceVariant=null)
 Perform variant conversion on a ParserOutput object.
 
 disableFallbackLanguageConverter ()
 Disable fallback language variant converter.
 
 setPageConfig (PageConfig $pageConfig)
 Set the PageConfig object to be used during language variant conversion.
 
 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 25 of file LanguageVariantConverter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::__construct ( PageIdentity $pageIdentity,
PageConfigFactory $pageConfigFactory,
Parsoid $parsoid,
array $parsoidSettings,
SiteConfig $siteConfig,
TitleFactory $titleFactory,
LanguageConverterFactory $languageConverterFactory,
LanguageFactory $languageFactory )

Member Function Documentation

◆ convertPageBundleVariant()

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

Perform variant conversion on a PageBundle object.

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

Definition at line 120 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 193 of file LanguageVariantConverter.php.

◆ disableFallbackLanguageConverter()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::disableFallbackLanguageConverter ( )

Disable fallback language variant converter.

Returns
void

Definition at line 208 of file LanguageVariantConverter.php.

◆ setPageConfig()

MediaWiki\Parser\Parsoid\LanguageVariantConverter::setPageConfig ( PageConfig $pageConfig)

Set the PageConfig object to be used during language variant conversion.

If not provided, the object will be created.

Parameters
PageConfig$pageConfig
Returns
void

Definition at line 95 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 105 of file LanguageVariantConverter.php.


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