Hooks for Translate extension. More...
Public Member Functions | |
__construct (RevisionLookup $revisionLookup, ILoadBalancer $loadBalancer, Config $config) | |
onRevisionRecordInserted ( $revisionRecord) | |
@inheritDoc | |
onListDefinedTags (&$tags) | |
@inheritDoc | |
onChangeTagsListActive (&$tags) | |
@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 48 of file TranslateHooks.php.
TranslateHooks::__construct | ( | RevisionLookup | $revisionLookup, |
ILoadBalancer | $loadBalancer, | ||
Config | $config ) |
Definition at line 66 of file TranslateHooks.php.
|
static |
Hook: MakeGlobalVariablesScript.
Adds $wgTranslateDocumentationLanguageCode to ResourceLoader configuration when Special:Translate is shown.
array | &$vars | |
OutputPage | $out |
Definition at line 805 of file TranslateHooks.php.
|
static |
Hook: AbortEmailNotification.
False aborts the email.
User | $editor | |
Title | $title | |
RecentChange | $rc |
Definition at line 897 of file TranslateHooks.php.
|
static |
Used for setting an AbuseFilter variable.
VariableHolder | &$vars | |
Title | $title | |
User | $user |
Definition at line 425 of file TranslateHooks.php.
|
static |
Register AbuseFilter variables provided by Translate.
array | &$builderValues |
Definition at line 479 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 454 of file TranslateHooks.php.
|
static |
TranslateHooks::onChangeTagsListActive | ( | & | $tags | ) |
@inheritDoc
Definition at line 1076 of file TranslateHooks.php.
|
static |
Hook: DeleteAccount For UserMerge extension.
User | $oldUser |
Definition at line 873 of file TranslateHooks.php.
TranslateHooks::onListDefinedTags | ( | & | $tags | ) |
@inheritDoc
Definition at line 1071 of file TranslateHooks.php.
|
static |
Hook: MergeAccountFromTo For UserMerge extension.
User | $oldUser | |
User | $newUser |
Definition at line 849 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 620 of file TranslateHooks.php.
TranslateHooks::onRevisionRecordInserted | ( | $revisionRecord | ) |
@inheritDoc
Definition at line 1034 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 916 of file TranslateHooks.php.
|
static |
Hook: UserGetReservedNames Prevents anyone from registering or logging in as FuzzyBot.
array | &$names |
Definition at line 413 of file TranslateHooks.php.
|
static |
|
static |
Hook: ParserAfterTidy.
Parser | $parser | |
string | &$html |
Definition at line 775 of file TranslateHooks.php.
|
static |
Hook: LoadExtensionSchemaUpdates.
DatabaseUpdater | $updater |
Definition at line 502 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchProfiles.
array | &$profiles |
Definition at line 653 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchProfileForm.
SpecialSearch | $search | |
string | &$form | |
string | $profile | |
string | $term | |
array | $opts |
Definition at line 687 of file TranslateHooks.php.
|
static |
Hook: SpecialSearchSetupEngine.
SpecialSearch | $search | |
string | $profile | |
SearchEngine | $engine |
Definition at line 753 of file TranslateHooks.php.
|
static |
Hook: ParserFirstCallInit Registers <languages> tag with the parser.
Parser | $parser |
Definition at line 492 of file TranslateHooks.php.
|
static |
Do late setup that depends on configuration.
Definition at line 79 of file TranslateHooks.php.
|
static |
Hook: ParserFirstCallInit.
Parser | $parser |
Definition at line 945 of file TranslateHooks.php.
|
static |
Hook: OutputPageParserOutput.
OutputPage | $outputPage | |
ParserOutput | $parserOutput |
Definition at line 790 of file TranslateHooks.php.
|
static |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages.
array | &$names | |
string | $code |
Definition at line 633 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 974 of file TranslateHooks.php.