Hooks for Translate extension. More...
Public Member Functions | |
__construct (RevisionLookup $revisionLookup, ILoadBalancer $loadBalancer, Config $config, LanguageNameUtils $languageNameUtils) | |
onUserGetReservedNames (&$reservedUsernames) | |
Prevents anyone from registering or logging in as FuzzyBot @inheritDoc. | |
onParserFirstCallInit ( $parser) | |
translateRenderParserFunction (Parser $parser) | |
onRevisionRecordInserted ( $revisionRecord) | |
@inheritDoc | |
onListDefinedTags (&$tags) | |
@inheritDoc | |
onChangeTagsListActive (&$tags) | |
@inheritDoc | |
Static Public Member Functions | |
static | setupTranslate () |
Do late setup that depends on configuration. | |
static | onAbuseFilterAlterVariables (VariableHolder &$vars, Title $title, User $user) |
Used for setting an AbuseFilter variable. | |
static | onAbuseFilterComputeVariable (string $method, VariableHolder $vars, array $parameters, ?string &$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 | onPageContentLanguage (Title $title, &$pageLang) |
Hook: PageContentLanguage Set the correct page content language for translation units. | |
static | translateMessageDocumentationLanguage (array &$names, ?string $code) |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages. | |
static | searchProfile (array &$profiles) |
Hook: SpecialSearchProfiles. | |
static | searchProfileForm (SpecialSearch $search, string &$form, string $profile, string $term, array $opts) |
Hook: SpecialSearchProfileForm. | |
static | searchProfileSetupEngine (SpecialSearch $search, string $profile, SearchEngine $engine) |
Hook: SpecialSearchSetupEngine. | |
static | preventCategorization (Parser $parser, string &$html) |
Hook: ParserAfterTidy. | |
static | showFakeCategories (OutputPage $outputPage, ParserOutput $parserOutput) |
Hook: OutputPageParserOutput. | |
static | addConfig (array &$vars, OutputPage $out) |
Hook: MakeGlobalVariablesScript Adds $wgTranslateDocumentationLanguageCode to ResourceLoader configuration when Special:Translate is shown. | |
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 ( $target, &$isKnown) |
Hook: TitleIsAlwaysKnown Make Special:MyLanguage links red if the target page doesn't exist. | |
static | validateMessage (IContextSource $context, Content $content, Status $status, string $summary, User $user) |
Runs the configured validator to ensure that the message meets the required criteria. | |
Hooks for Translate extension.
Contains class with basic non-feature specific hooks. 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 84 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::__construct | ( | RevisionLookup | $revisionLookup, |
ILoadBalancer | $loadBalancer, | ||
Config | $config, | ||
LanguageNameUtils | $languageNameUtils ) |
Definition at line 104 of file HookHandler.php.
|
static |
Hook: MakeGlobalVariablesScript Adds $wgTranslateDocumentationLanguageCode to ResourceLoader configuration when Special:Translate is shown.
Definition at line 722 of file HookHandler.php.
|
static |
Hook: AbortEmailNotification.
Definition at line 796 of file HookHandler.php.
|
static |
Used for setting an AbuseFilter variable.
Definition at line 484 of file HookHandler.php.
|
static |
Register AbuseFilter variables provided by Translate.
Definition at line 533 of file HookHandler.php.
|
static |
Computes the translate_source_text and translate_target_language AbuseFilter variables.
Definition at line 506 of file HookHandler.php.
|
static |
Hook: AdminLinks.
Definition at line 744 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onChangeTagsListActive | ( | & | $tags | ) |
@inheritDoc
Definition at line 962 of file HookHandler.php.
|
static |
Hook: DeleteAccount For UserMerge extension.
Definition at line 780 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onListDefinedTags | ( | & | $tags | ) |
@inheritDoc
Definition at line 957 of file HookHandler.php.
|
static |
Hook: MergeAccountFromTo For UserMerge extension.
Definition at line 758 of file HookHandler.php.
|
static |
Hook: PageContentLanguage Set the correct page content language for translation units.
Title | $title | |
Language | StubUserLang | string | &$pageLang |
Definition at line 556 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onParserFirstCallInit | ( | $parser | ) |
Definition at line 833 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onRevisionRecordInserted | ( | $revisionRecord | ) |
@inheritDoc
Definition at line 920 of file HookHandler.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 | Title object that is being checked |
bool | null | &$isKnown | Whether MediaWiki currently thinks this page is known |
Definition at line 812 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onUserGetReservedNames | ( | & | $reservedUsernames | ) |
Prevents anyone from registering or logging in as FuzzyBot @inheritDoc.
Definition at line 478 of file HookHandler.php.
|
static |
Hook: ParserAfterTidy.
Definition at line 689 of file HookHandler.php.
|
static |
Hook: SpecialSearchProfiles.
Definition at line 584 of file HookHandler.php.
|
static |
Hook: SpecialSearchProfileForm.
Definition at line 610 of file HookHandler.php.
|
static |
Hook: SpecialSearchSetupEngine.
Definition at line 671 of file HookHandler.php.
|
static |
Hook: ParserFirstCallInit Registers <languages> tag with the parser.
Definition at line 545 of file HookHandler.php.
|
static |
Do late setup that depends on configuration.
Definition at line 117 of file HookHandler.php.
|
static |
Hook: OutputPageParserOutput.
Definition at line 710 of file HookHandler.php.
|
static |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages.
Definition at line 567 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::translateRenderParserFunction | ( | Parser | $parser | ) |
Definition at line 837 of file HookHandler.php.
|
static |
Runs the configured validator to ensure that the message meets the required criteria.
Hook: EditFilterMergedContent
Definition at line 856 of file HookHandler.php.