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