Page MenuHomePhabricator

Message group state dropdown sometimes appears for source language
Closed, ResolvedPublicBug

Description

Steps to reproduce

  1. Create and mark a page for translation. Assuming that your preferred language and the page's source language are the same.
  2. View the page and click on Translate.
  3. You'll get a notice stating - The source language of this group is English. Please select another language to translate into. and you'll not see the message group state dropdown which is the expected behavior.
  4. Change to another language to translate. You'll now see the message group state dropdown.
  5. Change back to the source language.

Expected behavior

The message group state dropdown should no longer be displayed.

Actual behavior

You'll continue to see the message group state dropdown.

See image below,

Event Timeline

abi_ triaged this task as Low priority.Mar 5 2019, 9:26 AM
abi_ created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 5 2019, 9:26 AM
abi_ moved this task from Backlog to In Progress on the User-abi_ board.Mar 16 2019, 3:27 AM
abi_ added a comment.Mar 16 2019, 1:12 PM

This was a simple fix. After fetching messages groups from the API, updated the code in the message table component to hide the workflow states if the source langauge = target language.

Note that this depends on the changes made earlier for T217727: Special:PageMigration - "query - messagecollection" API throws an error. That needs to be merged first, before merging this.

Instead of removing the workflow selector from the DOM, I'm toggling the hide class. Not very happy with the workflow selector being controlled by the message table component but changing that would require some thought since message table makes the API call to fetch the messages, and the state of this component is decided on the basis of that API call.


Test cases

Enable Message group states. Set this up with automatic state changes by following instructions here. Test cases were run with the following value for $wgTranslateWorkflowStates,

$wgTranslateWorkflowStates = array(
	'unset' => array( 'color' => 'FF0000' ), // red
	'proofreading' => array( 'color' => 'd7f7f3' ), // light blue
	'ready' => array( 'color' => '00FF00' ), // green
	'inprogress' => array(
		'color' => 'FFFF00', // yellow
	),
	'state conditions' => array(
		array( 'ready', array( 'PROOFREAD' => 'MAX' ) ),
		array( 'proofreading', array( 'TRANSLATED' => 'MAX' ) ),
		array( 'unset', array( 'UNTRANSLATED' => 'MAX', 'OUTDATED' => 'ZERO', 'TRANSLATED' => 'ZERO' ) ),
		array( 'inprogress', array( 'UNTRANSLATED' => 'NONZERO' ) ),
	)
);

Please find the test cases below,

TC #1 - When target language is the source language, the workflow selector should not be visible

  1. Translate a page.
  2. Set the source language of the page as the target language
  3. Refresh the page.

Expected behavior - The workflow selector should not be visible after step 2, and should continue to be hidden after step 3.

TC #2 - When target language is not the source language, the workflow selector should be visible.

  1. Translate a page.
  2. Set the target language to a language different than the source language of the page.
  3. Refresh the page.

Expected behavior - You should see the workflow selector after step 2, and continue to see it after step 3.

TC #3 - Changing the target language from source language should hide the workflow selector

  1. Translate a page.
  2. Set the target language to a language different than the source language of the page.
  3. Then set the target language to the source language of the page.

Expected behavior - After step 2 you should see the workflow selector, but you should not see it after step 3.

Change 497121 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix: Hide workflow status when source language = target language

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

abi_ moved this task from In Progress to Under Review on the User-abi_ board.Mar 17 2019, 4:44 PM

Change 497121 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix: Hide workflow selector when source = target language for msg group

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

abi_ moved this task from Under Review to QA on the User-abi_ board.Mar 18 2019, 2:25 PM
abi_ removed a project: Patch-For-Review.

Moving to QA.

abi_ closed this task as Resolved.May 21 2019, 8:49 AM
abi_ moved this task from QA to Done on the User-abi_ board.

This is done. Screenshots from meta.wikimedia

Not appearing for English ( Target language changed from --> English --> French --> English)

Appearing for French