Page MenuHomePhabricator

Status "proofreading" does not make sense for the source language in Special:(Language|MessageGroup)Stats
Closed, ResolvedPublic

Description

https://meta.wikimedia.org/w/index.php?title=Special:MessageGroupStats&group=page-Meta%3AMeta%E2%80%93steward+relationship#sortable:3=asc

Source lang is English, but it is marked as "proofreading". I don't think that's accurate.

Regards.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 15 2017, 11:16 AM
Nikerabbit renamed this task from Source with status "proofreading" is not accurate to Status "proofreading" does not make sense for the source language in Special:(Language|MessageGroup)Stats.Mar 16 2017, 7:42 AM
Nikerabbit triaged this task as Low priority.
Nikerabbit added a project: good first bug.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMar 16 2017, 7:42 AM
Restricted Application added a project: User-MarcoAurelio. · View Herald TranscriptAug 15 2017, 10:56 AM

Merged duplicate task here.

Not trivial one line change but I don't see why this would be very complicated.

Essentially one just needs if ( $language === $group->getSourceLanguage() ) { skip... } in the right place. I haven't yet checked what the right place would be.

I am a newbie. I am interested to solve this bug. Can I get some more information about this bug.

@Dheerajmalisetty: You have been asked several times to please ask specific questions in tasks. "Can I get more info?" questions are neither specific nor useful.
See the task description and previous comments in this task for more information. If that is not enough information then you need to be specific and clear why not.

Nikerabbit moved this task from Backlog to Translate twn on the User-Nikerabbit board.
abi_ moved this task from Backlog to In Progress on the User-abi_ board.EditedMar 1 2019, 12:01 PM
abi_ added a subscriber: abi_.

@Nikerabbit - I've made the fix to not display proofread or any another message group state when displaying the Message group statistic and the Language statistic page ... but should we also handle,

  1. When user creates a page, the source language message group state should always be ready or empty?
  2. For existing wiki's using the Translate Extension with message group state, should we issue an SQL fix to set the state for the default language to empty?
abi_ moved this task from In Progress to Under Review on the User-abi_ board.Mar 1 2019, 7:46 PM

TODO

After reviewing the requirements of the task and the code, I came up with the following list of things to do,

  1. Language statistic page - If the language searched for happens to be the source language for a page displayed in the table, then the message group state is not displayed.
  2. Message group statistic page - As per the comments in the task, if the language displayed in the table happens to be the source language for the page, then the message group state is not displayed.
  3. Set the message group state value for the source language in the translate_groupreviews table to be empty going forward in the future.
  4. For existing wiki's using the Translate Extension with message group state, set the state for the source language to empty.

The commit implements #1 and #2 only as that's what is displayed to the user. Implementing #3 and #4, would require a larger change in the code and would increase the risk of things going wrong during the next plugin update (Since we'd have to write SQL queries to update the table for #4). We've decided that those two are not worth the extra effort and risk.

Observations

Noticed a small issue,

1. Message group state dropdown appears for source language

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,

Configuration

This task required certain configuration changes to be done to my DEV instance,

  1. Had to enable Message group states. Set this up with automatic state changes by following instructions here. Please see the value set for $wgTranslateWorkflowStates under the Test Cases section.
  2. Had to disable $wgMainCacheType = 'redis'; and set it to $wgMainCacheType = CACHE_NONE; as this was caching the /Special:LanguageStats page. See here.
  3. Also had a few issues with cache still not clearing because of the caching technique used in the Translate extension. See issue T217427. For the extension not to cache the SpecialLanguageStats page, had to, replace CACHE_ANYTHING in the SpecialLanguageStats::makeGroupRow function to global $wgMainCacheType

Test cases


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' ) ),
	)
);

Test cases below,

TC #1 - Message group state should not appear for source language in Language statistic page

  1. Create a page and mark it for translation. Assume that source language is English.
  2. Wait for a few seconds (for me it took about 12 seconds) while the MessageGroupStatesUpdaterJob runs, and sets the message group state for the language to proofreading in the translate_groupreviews table.
  3. Open the language statistic page, and uncheck the Suppress completely translated message groups option, search value should be en (source language).
  4. You should not see proofreading for the page listed. The column should be empty.

If you undo the changes from this commit, and refresh the page, you'll see the page with value proofreading.

TC #2 - Message group state should not appear for source language in Message group statistic page

Follow up from TC #1,

  1. Translate the previously created page and click on Message group statistic link.
  2. For the language en, you should see proofreading in the message group state column. The column should be empty.

If you undo the changes from this commit, and refresh the page, you'll see the page with value proofreading.

TC #3 - Message group state should appear for other languages in both pages

Follow up from TC #1,

  1. Translate the previously created page to French (fr). Translate some of the translation units, *but not all*.
  2. Wait for a few seconds while the MessageGroupStatesUpdaterJob runs.
  3. Open the Message group statistic page. You should see state as inprogress for the language fr.
  4. Open the Language statistic page and search for fr. You should see the page's message group state as inprogress.
abi_ claimed this task.Mar 1 2019, 7:47 PM
abi_ added a comment.Mar 3 2019, 2:57 PM

Patch for review: https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Translate/+/493745/

(Not sure why the Gerrit bot is not linking the patches, will check this)

Not sure why the Gerrit bot is not linking the patches

It says Task: T160511, it should say Bug: T160511

Change 493745 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Remove display of the message group state for the source language

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

abi_ added a comment.Mar 4 2019, 2:19 AM

@Aklapper - Thanks. I was under the impression that the label doesn't matter. I will amend the commit messages.

Change 493745 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Remove display of the message group state for the source language

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

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

Moving to QA status.

@abi_ - did you file a phab task about the issue?

Observations
Noticed a small issue,

  1. Message group state dropdown appears for source language

Steps to reproduce -

Create and mark a page for translation. Assuming that your preferred language and the page's source language are the same.
 View the page and click on Translate.
 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.
Change to another language to translate. You'll now see the message group state dropdown.

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.

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

This is fixed. Please see changes on meta.wikimedia

Message group statistics

Language statistics

Applies to pages where source language is English.