Hooks for Translate extension. More...
Public Member Functions | |
__construct (RevisionLookup $revisionLookup, ILoadBalancer $loadBalancer) | |
onRevisionRecordInserted ( $revisionRecord) | |
@inheritDoc | |
Static Public Member Functions | |
static | setupTranslate () |
Do late setup that depends on configuration. | |
static | onUserGetReservedNames (array &$names) |
Hook: UserGetReservedNames Prevents anyone from registering or logging in as FuzzyBot. | |
static | onAbuseFilterAlterVariables (&$vars, Title $title, User $user) |
Used for setting an AbuseFilter variable. | |
static | onAbuseFilterComputeVariable ( $method, $vars, $parameters, &$result) |
Computes the translate_source_text and translate_target_language AbuseFilter variables. | |
static | onAbuseFilterBuilder (array &$builderValues) |
Register AbuseFilter variables provided by Translate. | |
static | setupParserHooks (Parser $parser) |
Hook: ParserFirstCallInit Registers <languages> tag with the parser. | |
static | schemaUpdates (DatabaseUpdater $updater) |
Hook: LoadExtensionSchemaUpdates. | |
static | parserTestTables (array &$tables) |
Hook: ParserTestTables. | |
static | onPageContentLanguage (Title $title, &$pageLang) |
Hook: PageContentLanguage Set the correct page content language for translation units. | |
static | translateMessageDocumentationLanguage (array &$names, $code) |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages. | |
static | searchProfile (array &$profiles) |
Hook: SpecialSearchProfiles. | |
static | searchProfileForm (SpecialSearch $search, &$form, $profile, $term, array $opts) |
Hook: SpecialSearchProfileForm. | |
static | searchProfileSetupEngine (SpecialSearch $search, $profile, SearchEngine $engine) |
Hook: SpecialSearchSetupEngine. | |
static | preventCategorization (Parser $parser, &$html) |
Hook: ParserAfterTidy. | |
static | showFakeCategories (OutputPage $outputPage, ParserOutput $parserOutput) |
Hook: OutputPageParserOutput. | |
static | addConfig (array &$vars, OutputPage $out) |
Hook: MakeGlobalVariablesScript. | |
static | onAdminLinks (ALTree $tree) |
Hook: AdminLinks. | |
static | onMergeAccountFromTo (User $oldUser, User $newUser) |
Hook: MergeAccountFromTo For UserMerge extension. | |
static | onDeleteAccount (User $oldUser) |
Hook: DeleteAccount For UserMerge extension. | |
static | onAbortEmailNotificationReview (User $editor, Title $title, RecentChange $rc) |
Hook: AbortEmailNotification. | |
static | onTitleIsAlwaysKnown (Title $target, &$isKnown) |
Hook: TitleIsAlwaysKnown Make Special:MyLanguage links red if the target page doesn't exist. | |
static | setupTranslateParserFunction (Parser $parser) |
Hook: ParserFirstCallInit. | |
static | translateRenderParserFunction (Parser $parser) |
static | validateMessage (IContextSource $context, Content $content, Status $status, $summary, User $user) |
Runs the configured validator to ensure that the message meets the required criteria. | |
Hooks for Translate extension.
Main subsystems, like page translation, should have their own hook handler.
Most of the hooks on this class are still old style static functions, but new new hooks should use the new style hook handlers with interfaces.
Definition at line 42 of file TranslateHooks.php.
TranslateHooks::__construct | ( | RevisionLookup | $revisionLookup, |
ILoadBalancer | $loadBalancer ) |
Definition at line 58 of file TranslateHooks.php.
|
static |
Hook: MakeGlobalVariablesScript.
Adds $wgTranslateDocumentationLanguageCode to ResourceLoader configuration when Special:Translate is shown.
array | &$vars | |
OutputPage | $out |
Definition at line 758 of file TranslateHooks.php.
|
static |
Hook: AbortEmailNotification.
False aborts the email.
User | $editor | |
Title | $title | |
RecentChange | $rc |
Definition at line 850 of file TranslateHooks.php.
|
static |
Used for setting an AbuseFilter variable.
VariableHolder | &$vars | |
Title | $title | |
User | $user |
Definition at line 380 of file TranslateHooks.php.
|
static |
Register AbuseFilter variables provided by Translate.
array | &$builderValues |
Definition at line 434 of file TranslateHooks.php.
|
static |
Computes the translate_source_text and translate_target_language AbuseFilter variables.
string | $method | |
VariableHolder | $vars | |
array | $parameters | |
null | &$result |
Definition at line 409 of file TranslateHooks.php.
|
static |
|
static |
Hook: DeleteAccount For UserMerge extension.
User | $oldUser |
Definition at line 826 of file TranslateHooks.php.
|
static |
Hook: MergeAccountFromTo For UserMerge extension.
User | $oldUser | |
User | $newUser |
Definition at line 802 of file TranslateHooks.php.
|
static |
Hook: PageContentLanguage Set the correct page content language for translation units.
Title | $title | |
Language | StubUserLang | string | &$pageLang |
Definition at line 569 of file TranslateHooks.php.
TranslateHooks::onRevisionRecordInserted | ( | $revisionRecord | ) |
@inheritDoc
Definition at line 987 of file TranslateHooks.php.
|
static |
Hook: TitleIsAlwaysKnown Make Special:MyLanguage links red if the target page doesn't exist.
A bit hacky because the core code is not so flexible.
Title | $target | |
bool | &$isKnown |
Definition at line 869 of file TranslateHooks.php.
|
static |
Hook: UserGetReservedNames Prevents anyone from registering or logging in as FuzzyBot.
array | &$names |
Definition at line 368 of file TranslateHooks.php.
|
static |
|
static |
Hook: ParserAfterTidy.
Parser | $parser | |
string | &$html |
Definition at line 724 of file TranslateHooks.php.
|
static |
Hook: LoadExtensionSchemaUpdates.
DatabaseUpdater | $updater |
Definition at line 457 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchProfiles.
array | &$profiles |
Definition at line 602 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchProfileForm.
SpecialSearch | $search | |
string | &$form | |
string | $profile | |
string | $term | |
array | $opts |
Definition at line 636 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchSetupEngine.
SpecialSearch | $search | |
string | $profile | |
SearchEngine | $engine |
Definition at line 702 of file TranslateHooks.php.
|
static |
Hook: ParserFirstCallInit Registers <languages> tag with the parser.
Parser | $parser |
Definition at line 447 of file TranslateHooks.php.
|
static |
Do late setup that depends on configuration.
Definition at line 66 of file TranslateHooks.php.
|
static |
Hook: ParserFirstCallInit.
Parser | $parser |
Definition at line 898 of file TranslateHooks.php.
|
static |
Hook: OutputPageParserOutput.
OutputPage | $outputPage | |
ParserOutput | $parserOutput |
Definition at line 743 of file TranslateHooks.php.
|
static |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages.
array | &$names | |
string | $code |
Definition at line 582 of file TranslateHooks.php.
|
static |
|
static |
Runs the configured validator to ensure that the message meets the required criteria.
Hook: EditFilterMergedContent
IContextSource | $context | |
Content | $content | |
Status | $status | |
string | $summary | |
User | $user |
Definition at line 927 of file TranslateHooks.php.