Service to mark/unmark pages from translation and perform related validations.
More...
|
| __construct (IConnectionProvider $dbProvider, JobQueueGroup $jobQueueGroup, LinkRenderer $linkRenderer, MessageGroups $messageGroups, MessageIndex $messageIndex, TitleFormatter $titleFormatter, TitleParser $titleParser, TranslatablePageParser $translatablePageParser, TranslatablePageStore $translatablePageStore, TranslatablePageStateStore $translatablePageStateStore, TranslationUnitStoreFactory $translationUnitStoreFactory, MessageGroupMetadata $messageGroupMetadata, WikiPageFactory $wikiPageFactory, TranslatablePageView $translatablePageView, MessageGroupSubscription $messageGroupSubscription, FormatterFactory $formatterFactory) |
|
| unmarkPage (TranslatablePage $page, User $user, MessageLocalizer $localizer, bool $removeMarkup) |
| Remove a page from translation.
|
|
| getMarkOperation (PageRecord $page, ?int $revision, bool $validateUnitTitle) |
| Parse the given page and create a new MarkPageOperation with the page and the given revision if the revision is latest and that latest revision is ready to be marked.
|
|
| markForTranslation (TranslatablePageMarkOperation $operation, TranslatablePageSettings $pageSettings, MessageLocalizer $localizer, User $user) |
| This function does the heavy duty of marking a page.
|
|
| sendNotifications (array $sections, WikiPageMessageGroup $group, string $groupId, bool $isFirstMark) |
|
Service to mark/unmark pages from translation and perform related validations.
- Since
- 2023.10
Definition at line 41 of file TranslatablePageMarker.php.
◆ __construct()
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::__construct |
( |
IConnectionProvider | $dbProvider, |
|
|
JobQueueGroup | $jobQueueGroup, |
|
|
LinkRenderer | $linkRenderer, |
|
|
MessageGroups | $messageGroups, |
|
|
MessageIndex | $messageIndex, |
|
|
TitleFormatter | $titleFormatter, |
|
|
TitleParser | $titleParser, |
|
|
TranslatablePageParser | $translatablePageParser, |
|
|
TranslatablePageStore | $translatablePageStore, |
|
|
TranslatablePageStateStore | $translatablePageStateStore, |
|
|
TranslationUnitStoreFactory | $translationUnitStoreFactory, |
|
|
MessageGroupMetadata | $messageGroupMetadata, |
|
|
WikiPageFactory | $wikiPageFactory, |
|
|
TranslatablePageView | $translatablePageView, |
|
|
MessageGroupSubscription | $messageGroupSubscription, |
|
|
FormatterFactory | $formatterFactory ) |
◆ getMarkOperation()
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::getMarkOperation |
( |
PageRecord | $page, |
|
|
?int | $revision, |
|
|
bool | $validateUnitTitle ) |
Parse the given page and create a new MarkPageOperation with the page and the given revision if the revision is latest and that latest revision is ready to be marked.
- Parameters
-
PageRecord | $page | |
?int | $revision | Revision to use, or null to use the latest revision of the given page (i.e. not do the latest revision check) |
- Exceptions
-
TranslatablePageMarkException | If the revision was provided and was non-latest, or if the latest revision of the page is not ready to be marked |
ParsingFailure | If the parse fails |
Definition at line 149 of file TranslatablePageMarker.php.
◆ markForTranslation()
This function does the heavy duty of marking a page.
- Updates the source page with section markers.
- Updates translate_sections table
- Updates revtags table
- Sets up renderjobs to update the translation pages
- Invalidates caches
- Adds interim cache for MessageIndex
- Parameters
-
TranslatablePageMarkOperation | $operation | |
TranslatablePageSettings | $pageSettings | Contains information about priority languages, units that should not be fuzzed, whether title should be translated and other translatable page settings |
MessageLocalizer | $localizer | |
User | $user | User performing the action. Checking user permissions is the caller’s responsibility |
- Returns
- int The number of translation units actually used
Definition at line 286 of file TranslatablePageMarker.php.
◆ sendNotifications()
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::sendNotifications |
( |
array | $sections, |
|
|
WikiPageMessageGroup | $group, |
|
|
string | $groupId, |
|
|
bool | $isFirstMark ) |
◆ unmarkPage()
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::unmarkPage |
( |
TranslatablePage | $page, |
|
|
User | $user, |
|
|
MessageLocalizer | $localizer, |
|
|
bool | $removeMarkup ) |
Remove a page from translation.
- Parameters
-
TranslatablePage | $page | The page to remove from translation |
User | $user | The user performing the action |
MessageLocalizer | $localizer | |
bool | $removeMarkup | Whether to remove markup from the translation page |
- Exceptions
-
TranslatablePageMarkException | If removing the markup from the translation page fails |
Definition at line 106 of file TranslatablePageMarker.php.
◆ DEFAULT_SYNTAX_VERSION
const MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::DEFAULT_SYNTAX_VERSION = '1' |
◆ LATEST_SYNTAX_VERSION
const MediaWiki\Extension\Translate\PageTranslation\TranslatablePageMarker::LATEST_SYNTAX_VERSION = '2' |
The documentation for this class was generated from the following file: