17 private TemplateParser $templateParser;
19 public function __construct() {
20 parent::__construct(
'PagePreparation',
'pagetranslation' );
21 $this->templateParser =
new TemplateParser( __DIR__ .
'/templates' );
24 protected function getGroupName():
string {
30 $request = $this->getRequest();
31 $output = $this->getOutput();
33 $this->checkPermissions();
34 $this->outputHeader();
36 $output->addModules(
'ext.translate.special.pagepreparation' );
37 $output->addModuleStyles( [
38 'ext.translate.specialpages.styles',
43 $this->getHtml( $request->getText(
'page', $par ??
'' ) )
47 $this->msg(
'tux-nojs' )->escaped(),
54 public function getHtml(
string $inputValue ): string {
55 $diff = new DifferenceEngine( $this->getContext() );
56 $diffHeader = $diff->addHeader(
' ', $this->msg(
'pp-diff-old-header' )->escaped(),
57 $this->msg(
'pp-diff-new-header' )->escaped() );
60 'pagenamePlaceholder' => $this->msg(
'pp-pagename-placeholder' )->text(),
61 'prepareButtonLabel' => $this->msg(
'pp-prepare-button-label' )->text(),
62 'saveButtonLabel' => $this->msg(
'pp-save-button-label' )->text(),
63 'cancelButtonLabel' => $this->msg(
'pp-cancel-button-label' )->text(),
64 'summaryValue' => $this->msg(
'pp-save-summary' )->inContentLanguage()->text(),
65 'inputValue' => $inputValue,
66 'diffHeaderHtml' => $diffHeader
69 return $this->templateParser->processTemplate(
'PrepareTranslatablePageTemplate', $data );