Hooks for page translation. More...
Static Public Member Functions | |
static | renderTagPage ($parser, &$text, $state) |
Hook: ParserBeforeStrip. | |
static | onPageContentLanguage (Title $title, &$pageLang) |
Set the right page content language for translated pages ("Page/xx"). | |
static | injectCss (OutputPage $out, $text) |
Hook: OutputPageBeforeHTML. | |
static | onSectionSave ($wikiPage, User $user, $content, $summary, $minor, $_, $_, $flags, $revision) |
Hook: ArticleSaveComplete, PageContentSaveComplete. | |
static | updateTranslationPage (TranslatablePage $page, $code, $user, $flags, $summary) |
static | languages ($data, $params, $parser) |
static | tpSyntaxCheckForEditContent ($context, $content, $status, $summary) |
Display nice error when editing content. | |
static | tpSyntaxCheckForEditPage ($editpage, $text, &$error, $summary) |
Display nice error for editpage. | |
static | tpSyntaxCheck ($wikiPage, $user, $content, $summary, $minor, $_, $_, $flags, $status) |
When attempting to save, last resort. | |
static | addTranstag ($wikiPage, $user, $content, $summary, $minor, $_, $_, $flags, $revision) |
Hook: ArticleSaveComplete, PageContentSaveComplete. | |
static | updateTranstagOnNullRevisions (Revision $rev, $text, $flags) |
Page moving and page protection (and possibly other things) creates null revisions. | |
static | preventUnknownTranslations (Title $title, User $user, $action, &$result) |
Prevent editing of unknown pages in Translations namespace. | |
static | preventRestrictedTranslations (Title $title, User $user, $action, &$result) |
Prevent editing of restricted languages Hook: getUserPermissionsErrorsExpensive. | |
static | preventDirectEditing (Title $title, User $user, $action, &$result) |
Prevent editing of translation pages directly. | |
static | disableDelete ($article, $out, &$reason) |
Redirects the delete action to our own for translatable pages. | |
static | translatablePageHeader (&$article, &$outputDone, &$pcache) |
Hook: ArticleViewHeader. | |
static | replaceMovePage (&$list) |
Hook: SpecialPage_initList. | |
static | lockedPagesCheck (Title $title, User $user, $action, &$result) |
Hook: getUserPermissionsErrorsExpensive. | |
static | replaceSubtitle (&$subpages, $skin=null, OutputPage $out) |
Hook: SkinSubPageSubtitle. | |
static | sourceExport (RequestContext $context, TranslateTask $task=null, MessageGroup $group, array $options) |
Hook: SpecialTranslate::executeTask. | |
static | translateTab (Skin $skin, array &$tabs) |
Converts the edit tab (if exists) for translation pages to translate tab. | |
Static Public Attributes | |
static | $allowTargetEdit = false |
Static Protected Member Functions | |
static | tpSyntaxError ($title, $text) |
Returns any syntax error. | |
static | sourcePageHeader (Title $title) |
static | translationPageHeader (Title $title) |
Hooks for page translation.
Definition at line 16 of file PageTranslationHooks.php.
static PageTranslationHooks::addTranstag | ( | $ | wikiPage, | |
$ | user, | |||
$ | content, | |||
$ | summary, | |||
$ | minor, | |||
$ | _, | |||
$ | _, | |||
$ | flags, | |||
$ | revision | |||
) | [static] |
Hook: ArticleSaveComplete, PageContentSaveComplete.
Definition at line 433 of file PageTranslationHooks.php.
static PageTranslationHooks::disableDelete | ( | $ | article, | |
$ | out, | |||
&$ | reason | |||
) | [static] |
Redirects the delete action to our own for translatable pages.
Hook: ArticleConfirmDelete
$article | Article | |
$out | OutputPage | |
$reason |
Definition at line 628 of file PageTranslationHooks.php.
static PageTranslationHooks::injectCss | ( | OutputPage $ | out, | |
$ | text | |||
) | [static] |
Hook: OutputPageBeforeHTML.
Definition at line 76 of file PageTranslationHooks.php.
static PageTranslationHooks::languages | ( | $ | data, | |
$ | params, | |||
$ | parser | |||
) | [static] |
$data | ||
$params | ||
$parser | Parser |
Definition at line 180 of file PageTranslationHooks.php.
static PageTranslationHooks::lockedPagesCheck | ( | Title $ | title, | |
User $ | user, | |||
$ | action, | |||
&$ | result | |||
) | [static] |
Hook: getUserPermissionsErrorsExpensive.
Definition at line 769 of file PageTranslationHooks.php.
static PageTranslationHooks::onPageContentLanguage | ( | Title $ | title, | |
&$ | pageLang | |||
) | [static] |
Set the right page content language for translated pages ("Page/xx").
Hook: PageContentLanguage
Definition at line 64 of file PageTranslationHooks.php.
static PageTranslationHooks::onSectionSave | ( | $ | wikiPage, | |
User $ | user, | |||
$ | content, | |||
$ | summary, | |||
$ | minor, | |||
$ | _, | |||
$ | _, | |||
$ | flags, | |||
$ | revision | |||
) | [static] |
Hook: ArticleSaveComplete, PageContentSaveComplete.
Change to this line once BC is 1.21 and later: public static function onSectionSave( WikiPage $wikiPage, User $user, $content, $summary,
Definition at line 98 of file PageTranslationHooks.php.
static PageTranslationHooks::preventDirectEditing | ( | Title $ | title, | |
User $ | user, | |||
$ | action, | |||
&$ | result | |||
) | [static] |
Prevent editing of translation pages directly.
Hook: getUserPermissionsErrorsExpensive
Definition at line 589 of file PageTranslationHooks.php.
static PageTranslationHooks::preventRestrictedTranslations | ( | Title $ | title, | |
User $ | user, | |||
$ | action, | |||
&$ | result | |||
) | [static] |
Prevent editing of restricted languages Hook: getUserPermissionsErrorsExpensive.
Definition at line 542 of file PageTranslationHooks.php.
static PageTranslationHooks::preventUnknownTranslations | ( | Title $ | title, | |
User $ | user, | |||
$ | action, | |||
&$ | result | |||
) | [static] |
Prevent editing of unknown pages in Translations namespace.
Hook: getUserPermissionsErrorsExpensive
Definition at line 522 of file PageTranslationHooks.php.
static PageTranslationHooks::renderTagPage | ( | $ | parser, | |
&$ | text, | |||
$ | state | |||
) | [static] |
Hook: ParserBeforeStrip.
$parser | Parser | |
$text | ||
$state |
Definition at line 27 of file PageTranslationHooks.php.
static PageTranslationHooks::replaceMovePage | ( | &$ | list | ) | [static] |
Hook: SpecialPage_initList.
Definition at line 761 of file PageTranslationHooks.php.
static PageTranslationHooks::replaceSubtitle | ( | &$ | subpages, | |
$ | skin = null , |
|||
OutputPage $ | out | |||
) | [static] |
Hook: SkinSubPageSubtitle.
Definition at line 787 of file PageTranslationHooks.php.
static PageTranslationHooks::sourceExport | ( | RequestContext $ | context, | |
TranslateTask $ | task = null , |
|||
MessageGroup $ | group, | |||
array $ | options | |||
) | [static] |
Hook: SpecialTranslate::executeTask.
Definition at line 845 of file PageTranslationHooks.php.
static PageTranslationHooks::sourcePageHeader | ( | Title $ | title | ) | [static, protected] |
Definition at line 668 of file PageTranslationHooks.php.
Referenced by translatablePageHeader().
static PageTranslationHooks::tpSyntaxCheck | ( | $ | wikiPage, | |
$ | user, | |||
$ | content, | |||
$ | summary, | |||
$ | minor, | |||
$ | _, | |||
$ | _, | |||
$ | flags, | |||
$ | status | |||
) | [static] |
When attempting to save, last resort.
Edit page would only display edit conflict if there wasn't tpSyntaxCheckForEditPage Hook: ArticleSave, PageContentSave
Definition at line 400 of file PageTranslationHooks.php.
static PageTranslationHooks::tpSyntaxCheckForEditContent | ( | $ | context, | |
$ | content, | |||
$ | status, | |||
$ | summary | |||
) | [static] |
Display nice error when editing content.
Hook: EditFilterMergedContent (since MW 1.21)
Definition at line 341 of file PageTranslationHooks.php.
static PageTranslationHooks::tpSyntaxCheckForEditPage | ( | $ | editpage, | |
$ | text, | |||
&$ | error, | |||
$ | summary | |||
) | [static] |
Display nice error for editpage.
Hook: EditFilterMerged (until MW 1.20)
Definition at line 366 of file PageTranslationHooks.php.
static PageTranslationHooks::tpSyntaxError | ( | $ | title, | |
$ | text | |||
) | [static, protected] |
Returns any syntax error.
Definition at line 380 of file PageTranslationHooks.php.
Referenced by tpSyntaxCheckForEditContent(), and tpSyntaxCheckForEditPage().
static PageTranslationHooks::translatablePageHeader | ( | &$ | article, | |
&$ | outputDone, | |||
&$ | pcache | |||
) | [static] |
Hook: ArticleViewHeader.
$article | Article | |
$outputDone | ||
$pcache |
Definition at line 651 of file PageTranslationHooks.php.
static PageTranslationHooks::translateTab | ( | Skin $ | skin, | |
array &$ | tabs | |||
) | [static] |
Converts the edit tab (if exists) for translation pages to translate tab.
Hook: SkinTemplateNavigation
Definition at line 873 of file PageTranslationHooks.php.
static PageTranslationHooks::translationPageHeader | ( | Title $ | title | ) | [static, protected] |
Definition at line 728 of file PageTranslationHooks.php.
Referenced by translatablePageHeader().
static PageTranslationHooks::updateTranslationPage | ( | TranslatablePage $ | page, | |
$ | code, | |||
$ | user, | |||
$ | flags, | |||
$ | summary | |||
) | [static] |
Definition at line 143 of file PageTranslationHooks.php.
Referenced by onSectionSave().
static PageTranslationHooks::updateTranstagOnNullRevisions | ( | Revision $ | rev, | |
$ | text, | |||
$ | flags | |||
) | [static] |
Page moving and page protection (and possibly other things) creates null revisions.
These revisions re-use the previous text already stored in the database. Those however do not trigger re-parsing of the page and thus the ready tag is not updated. This watches for new revisions, checks if they reuse existing text, checks whether the parent version is the latest version and has a ready tag. If that is the case, also adds a ready tag for the new revision (which is safe, because the text hasn't changed). The interface will say that there has been a change, but shows no change in the content. This lets the user to update the translation pages in the case, the non-text changes affect the rendering of translation pages. I'm not aware of any such cases at the moment. Hook: RevisionInsertComplete
Definition at line 479 of file PageTranslationHooks.php.
PageTranslationHooks::$allowTargetEdit = false [static] |
Definition at line 18 of file PageTranslationHooks.php.
Referenced by TranslateRenderJob::run(), TranslateMoveJob::run(), and TranslateDeleteJob::run().