Page MenuHomePhabricator

SecurePoll (votewiki) should import translations from Meta-Wiki
Open, HighPublicFeature

Description

Feature summary (what you would like to be able to do and where):

  • The SecurePoll implementation on votewiki should import translations from Meta-Wiki directly (or some other community-translatable place, e.g. TranslateWiki).

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Benefits (why should this be implemented?):

  • This implementation would make translations much easier to import into SecurePoll on votewiki, saving time and increasing the scalability of the whole process.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJun 17 2022, 4:53 PM
jrbs triaged this task as High priority.Sep 23 2022, 10:13 PM

Change 853945 had a related patch set uploaded (by Mschlindwein; author: Mschlindwein):

[mediawiki/extensions/SecurePoll@master] Add TranslationParser for parsing content for import

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

We have started working on this. The following steps will be performed:

  1. Implement a parsing logic that allows to extract translation messages from META wiki pages
  2. Refactor out "translation saving" logic from "translate action page" and make it available through a REST endpoint
  3. Implement UI Dialog for fetching/parsing and saving the translations
  4. Implement UI improvements for "translation overview page"

For item 1 there is already a change in CR: https://gerrit.wikimedia.org/r/853945
All other changes will depend on that one

We detected another change that has conflicts: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SecurePoll/+/463610
It looks like it was ready for merging. We need to discuss this in the next meeting.

Change 859326 had a related patch set uploaded (by Mschlindwein; author: Mschlindwein):

[mediawiki/extensions/SecurePoll@master] Add Rest endpoint and logic for saving translations

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

Change 867519 had a related patch set uploaded (by Mschlindwein; author: Mschlindwein):

[mediawiki/extensions/SecurePoll@master] Add dialog to import dialog

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

Tchanders added subscribers: STran, Tchanders.

Assigning to @STran who has been tasked with reviewing this (but feel free to reassign to the author!)

Change 853945 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add TranslationParser for parsing content for import

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

Change 859326 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add Rest endpoint and logic for saving translations

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

Change 867519 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add dialog to import dialog

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

@dom_walden @GMikesell-WMF Could I ask one of you to QA this? I tested this by:

  1. set $wgSecurePollTranslationImportSourceUrl = 'http://localhost:8080/w/api.php'; where the URL is wherever your API is
  2. Creating pages TestElection/en, TestElection/fr and populated with values from the test txt files in the patches
  3. Checking any "translate" page for a poll, doesn't matter if it's expired or not, ideally with all the message keys that the txt files have but it should fill out any that match
  4. There should be a "Import Translations" button that will open a dialog
  5. Submitting "TestElection" should show /en and /fr as translated and you can navigate to the poll translations to confirm it

@schli

Change 867519 had a related patch set uploaded (by Mschlindwein; author: Mschlindwein):

[mediawiki/extensions/SecurePoll@master] Add dialog to import dialog

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

Hi,

A question about this one. It adds the message "Start page $1 to import" (securepoll-translation-importer-update-start). What does "Start" mean here? Is it an adjective that describes the page, as in "the first page" or "the landing page"? Is it an imperative verb? Something else?

Moving to Done, since @jrbs will QA. But please reach out to @dom_walden and @GMikesell-WMF if you want QA help.

@STran Do you know the answer to @Amire80's question?

@Amire80 It's describing a state in the progress indicator during the import dialog:

image.png (382ร—1 px, 29 KB)

Maybe a better phrasing would be 'Starting import for page $1'? Or 'Importing page $1''?

Thanks. Unless there are stages other than "Starting", simply saying "Importing page $1" is probably the best solution.

Change 915100 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SecurePoll@master] Update page import statue message

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

Change 915100 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Update page import statue message

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