2declare( strict_types = 1 );
4namespace MediaWiki\Extension\Translate\TranslatorInterface;
8use MediaWiki\Diff\Hook\ArticleContentOnDiffHook;
9use MediaWiki\Hook\AlternateEditHook;
10use MediaWiki\Hook\EditPage__showEditForm_initialHook;
11use MediaWiki\Languages\LanguageFactory;
21 implements AlternateEditHook, ArticleContentOnDiffHook, EditPage__showEditForm_initialHook
24 private $languageFactory;
26 public function __construct( LanguageFactory $languageFactory ) {
27 $this->languageFactory = $languageFactory;
36 if ( $handle->isValid() ) {
37 $editPage->suppressIntro =
true;
50 if ( !$handle->isValid() ) {
54 $context = $out->getContext();
55 $request = $context->getRequest();
57 if ( $editPage->firsttime && !$request->getCheck(
'oldid' ) &&
58 !$request->getCheck(
'undo' ) ) {
59 if ( $handle->isFuzzy() ) {
60 $editPage->textbox1 = TRANSLATE_FUZZY . $editPage->textbox1;
64 $th =
new LegacyTranslationAids( $handle, $context, $this->languageFactory );
65 $editPage->editFormTextTop .= $th->getBoxes();
74 $title = $diffEngine->getTitle();
77 if ( !$handle->isValid() ) {
82 $output->addHTML( $th->getBoxes() );
Class for pointing to messages, like Title class is for titles.