2declare( strict_types = 1 );
6namespace MediaWiki\Extension\Translate;
23use MediaWiki\HookContainer\HookContainer;
24use MediaWiki\User\User;
25use MediaWiki\User\UserIdentity;
53 private HookContainer $hookContainer;
55 public function __construct( HookContainer $hookContainer ) {
56 $this->hookContainer = $hookContainer;
60 $this->hookContainer->run(
'Translate:TranslatorSandbox:UserPromoted', [ $user ], [
'abortable' => false ] );
64 return $this->hookContainer->run(
'TranslatePrefillTranslation', [ &$translation, $handle ] );
68 return $this->hookContainer->run(
'TranslateBeforeAddModules', [ &$modules ] );
72 return $this->hookContainer->run(
'TranslateEventTranslationReview', [ $handle ] );
76 return $this->hookContainer->run(
'TranslateGetSpecialTranslateOptions', [ &$defaults, &$nonDefaults ] );
80 return $this->hookContainer->run(
'Translate:newTranslation', [ $handle, $revisionId, $text, $user ] );
84 return $this->hookContainer->run(
'Translate:modifyMessageGroupStates', [ $groupId, &$conf ] );
93 return $this->hookContainer->run(
'TranslateEventMessageGroupStateChange',
94 [ $group, $code, $oldState, $newState ] );
98 return $this->hookContainer->run(
'TranslateInitGroupLoaders', [ &$groupLoader, $deps ] );
102 return $this->hookContainer->run(
'TranslatePostInitGroups', [ &$groups, &$deps, &$autoload ] );
111 return $this->hookContainer->run(
'TranslateProcessAPIMessageGroupsProperties', [ &$a, $props, $params, $g ] );
115 return $this->hookContainer->run(
'TranslateSupportedLanguages', [ &$list, $language ] );
119 return $this->hookContainer->run(
'TranslateEventMessageMembershipChange', [ $handle, $old, $new ] );
127 return $this->hookContainer->run(
128 'Translate:GettextFormat:headerFields',
129 [ &$headers, $group, $languageCode ]
This is a hook handler interface, see docs/Hooks.md in core.
Interface for message groups.