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 83 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::__construct | ( | RevisionLookup | $revisionLookup, |
ILoadBalancer | $loadBalancer, | ||
Config | $config, | ||
LanguageNameUtils | $languageNameUtils ) |
Definition at line 103 of file HookHandler.php.
|
static |
Hook: MakeGlobalVariablesScript Adds $wgTranslateDocumentationLanguageCode to ResourceLoader configuration when Special:Translate is shown.
Definition at line 741 of file HookHandler.php.
|
static |
Hook: AbortEmailNotification.
Definition at line 815 of file HookHandler.php.
|
static |
Used for setting an AbuseFilter variable.
Definition at line 501 of file HookHandler.php.
|
static |
Register AbuseFilter variables provided by Translate.
Definition at line 550 of file HookHandler.php.
|
static |
Computes the translate_source_text and translate_target_language AbuseFilter variables.
Definition at line 523 of file HookHandler.php.
|
static |
Hook: AdminLinks.
Definition at line 763 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onChangeTagsListActive | ( | & | $tags | ) |
@inheritDoc
Definition at line 984 of file HookHandler.php.
|
static |
Hook: DeleteAccount For UserMerge extension.
Definition at line 799 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onListDefinedTags | ( | & | $tags | ) |
@inheritDoc
Definition at line 979 of file HookHandler.php.
|
static |
Hook: MergeAccountFromTo For UserMerge extension.
Definition at line 777 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 573 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onParserFirstCallInit | ( | $parser | ) |
Definition at line 852 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onRevisionRecordInserted | ( | $revisionRecord | ) |
@inheritDoc
Definition at line 942 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 831 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::onUserGetReservedNames | ( | & | $reservedUsernames | ) |
Prevents anyone from registering or logging in as FuzzyBot @inheritDoc.
Definition at line 495 of file HookHandler.php.
|
static |
Hook: ParserAfterTidy.
Definition at line 705 of file HookHandler.php.
|
static |
Hook: SpecialSearchProfiles.
Definition at line 601 of file HookHandler.php.
|
static |
Hook: SpecialSearchProfileForm.
Definition at line 627 of file HookHandler.php.
|
static |
Hook: SpecialSearchSetupEngine.
Definition at line 687 of file HookHandler.php.
|
static |
Hook: ParserFirstCallInit Registers <languages> tag with the parser.
Definition at line 562 of file HookHandler.php.
|
static |
Do late setup that depends on configuration.
Definition at line 116 of file HookHandler.php.
|
static |
Hook: OutputPageParserOutput.
Definition at line 729 of file HookHandler.php.
|
static |
Hook: LanguageGetTranslatedLanguageNames Hook: TranslateSupportedLanguages.
Definition at line 584 of file HookHandler.php.
MediaWiki\Extension\Translate\HookHandler::translateRenderParserFunction | ( | Parser | $parser | ) |
Definition at line 856 of file HookHandler.php.
|
static |
Runs the configured validator to ensure that the message meets the required criteria.
Hook: EditFilterMergedContent
Definition at line 878 of file HookHandler.php.