Page MenuHomePhabricator

Integrate TranslateTagger functions/workflow into Special:PagePreparation of Translate Extension
Closed, ResolvedPublic2 Estimated Story Points

Description

Special:PagePreparation, findable across multilingual wikis where Translate extension is installed, has been outdated since a long. TranslateTagger tries to resolve these problems, and it would be more convenient to have the work incorporated into the MediaWiki extension itself.

Scope

Actually enabling this on production wiki's will be reviewed/done in a separate ticket

QA Plan

This will have to be tested locally since there are further considerations before we can enable it on production
Set the configuration variable:

$wgTranslateEnableTranslateTaggerAPIIntegration = 'https://translatetagger.toolforge.org/api/convert';
  • Handles API failures properly
  • Put the incorrect URL for the translate tagger API
  • Make the API call
  • Ensure that a proper error message is displayed to the user.
  • Ensure that the translate tagger button is not displayed if configuration is not set
  • Remove the $wgTranslateEnableTranslateTaggerAPIIntegration configuration
  • On Special:PagePreparation ensure that the button to mark up with translate tagger is hidden.

Event Timeline

The front end code for Special:PagePreparation is present in resources/js/ext.translate.special.pagepreparation.js.

Lets add a separate button to enable page preparation using translate tagger API.

image.png (1,161×558 px, 36 KB)

Handle errors from the translate tagger API and inform users of errors, so that they can revert back to using the old page preparation logic.

Translate tagger API: https://translatetagger.toolforge.org/docs#ref-features

abi_ triaged this task as Medium priority.Jul 1 2026, 1:10 PM
abi_ added a project: LPL sprints.
abi_ moved this task from Backlog to Maintenance initiatives on the LPL sprints board.
abi_ set the point value for this task to 2.

Change #1306089 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Special:PagePreparation: Integrate Translate Tagger API

https://gerrit.wikimedia.org/r/1306089

We can't test this on production wikis but I can test this on our test servers.

abi_ moved this task from Needs QA to Owner acceptance on the LPL sprints (S1 2026 July) board.

I pulled in the main branch, set the local configuration and tested the functionality:

$wgTranslateEnableTranslateTaggerAPIIntegration = 'https://translatetagger.toolforge.org/api/convert';

Verify that markup structure matches what's displayed on https://translatetagger.toolforge.org/

image.png (1,335×1,906 px, 317 KB)

Handles API failures properly

Testing with incorrect URL:

image.png (1,410×549 px, 51 KB)

Ensure that the translate tagger button is not displayed if configuration is not set

Removed the configuration.

image.png (1,378×529 px, 31 KB)

Verify that markup structure matches what's displayed on https://translatetagger.toolforge.org/

image.png (1,335×1,906 px, 317 KB)

This is unrelated to the present task (it’s a bug in TranslateTagger), but I noticed it now: that load of <translate> tags shouldn’t be there; regular paragraphs can and should be included in larger <translate> blobs, and only syntax like lists needs to be wrapped one-by-one, e.g.

<translate>
'''Springfield''' is a city…

== History ==

Founded in 1885…

== Geography ==

According to the…

== Economy ==

Historically driven by…
</translate>
* <translate>McKenzie-River Regional Hospital</translate>
* <translate>Springfield School District</translate>

Handles API failures properly

Testing with incorrect URL:

image.png (1,410×549 px, 51 KB)

This is related to the current task: shouldn’t the error box have an icon? Codex error boxes usually have icons.