Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter Class Reference

Service to import a translatable bundle from a file. More...

Inheritance diagram for MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter:

Public Member Functions

 __construct (private readonly WikiImporterFactory $wikiImporterFactory, private readonly TranslatablePageParser $translatablePageParser, private readonly RevisionLookup $revisionLookup, private readonly NamespaceInfo $namespaceInfo, private readonly TitleFactory $titleFactory, private readonly FormatterFactory $formatterFactory,)
 
 import (string $importFilePath, string $interwikiPrefix, bool $assignKnownUsers, UserIdentity $user, MessageLocalizer $localizer, ?Title $targetPage, ?string $comment)
 
 setPageImportCompleteCallback (callable $callable)
 
 onAfterImportPage ( $title, $foreignTitle, $revCount, $sRevCount, $pageInfo)
 @inheritDoc
 

Static Public Member Functions

static getInstance ()
 Factory method used to initialize this HookHandler.
 

Detailed Description

Service to import a translatable bundle from a file.

Uses WikiImporter from MediaWiki core.

Since
2023.05 @license GPL-2.0-or-later
Author
Abijeet Patro

Definition at line 32 of file TranslatableBundleImporter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter::__construct ( private readonly WikiImporterFactory $wikiImporterFactory,
private readonly TranslatablePageParser $translatablePageParser,
private readonly RevisionLookup $revisionLookup,
private readonly NamespaceInfo $namespaceInfo,
private readonly TitleFactory $titleFactory,
private readonly FormatterFactory $formatterFactory )

Definition at line 38 of file TranslatableBundleImporter.php.

Member Function Documentation

◆ getInstance()

static MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter::getInstance ( )
static

Factory method used to initialize this HookHandler.

Definition at line 49 of file TranslatableBundleImporter.php.

◆ import()

MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter::import ( string $importFilePath,
string $interwikiPrefix,
bool $assignKnownUsers,
UserIdentity $user,
MessageLocalizer $localizer,
?Title $targetPage,
?string $comment )
Exceptions
TranslatableBundleImportException

Definition at line 54 of file TranslatableBundleImporter.php.

◆ onAfterImportPage()

MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter::onAfterImportPage ( $title,
$foreignTitle,
$revCount,
$sRevCount,
$pageInfo )

@inheritDoc

Definition at line 158 of file TranslatableBundleImporter.php.

◆ setPageImportCompleteCallback()

MediaWiki\Extension\Translate\MessageGroupProcessing\TranslatableBundleImporter::setPageImportCompleteCallback ( callable $callable)

Definition at line 115 of file TranslatableBundleImporter.php.


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