Page MenuHomePhabricator

Show proper notice when translations to non-priority language is blocked
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
abi_
Mar 20 2019, 1:18 PM
Referenced Files
F29179714: image.png
May 21 2019, 9:09 AM
F29179524: image.png
May 21 2019, 9:09 AM
F29179647: image.png
May 21 2019, 9:09 AM
F29179504: image.png
May 21 2019, 9:09 AM
F28410181: image.png
Mar 20 2019, 1:18 PM
F28310499: non-prio-lang-save-1.png
Mar 20 2019, 1:18 PM
Subscribers

Description

Steps to Reproduce:

  1. Mark a page for translation with a priority language set and the option - Prevent translations to languages other than the priority languages set,
  2. Now try to translate the page into another non-priority language.

Actual Results:

You see the message - Translating to XYZ is not a priority for this page

See image below,

non-prio-lang-save-1.png (728×1 px, 52 KB)

This message does not give the translator an indication that translations to non-priority languages are disabled.

Expected Results:

Instead a message should be shown stating that translations to non-priority languages are disabled.

image.png (518×1 px, 37 KB)

Related : T217416: Disable Save button when saving a non-priority language with "Prevent translations to languages other than the priority.." is set

Event Timeline

Change 498306 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix improper notice when translating to non-priority language

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

This was a small change. Updated the code in the specific function (ext.translate.base.js -> getMessageGroup) to use version 2. This is being called from two places,

  1. Special:Translation - ext.translate.special.translate.js
  2. Workflow selector - ext.translate.workflowselector.js

Tested to ensure that the change works as expected in both the sections along with fixing the bug.


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 - Proper notice is displayed when translating to non-priority language

  1. Mark a page for translation, set one or more languages as priority languages. Check the option - Prevent translations to languages other than priority languages
  2. Click on translate the page.
  3. Set the target language to a language that is not in the priority language list.

Expected Behavior - You should see an notice stating that translation to languages other than the priority languages is disabled.

TC #2 - Workflow selector should display all the possible states and the correct state of the page

Continued from #TC #1,

  1. Translate the page and select the target lagnuage as one of the priority language.
  2. Translate messages, but not all.
  3. Translate all messages.

Expected Behavior

  • After step 2, the workflow state selector should show - State: inprogress
  • After step 3, the workflow state selector should show - State: proofreading

Note, that it takes a bit of time for the workflow state selector to show the update state. You might also need to switch between tabs or refresh the page.

TC #3 - Proper notice is dispalyed when translating to non-priority language without priority force set

priority force - true when option Prevent translations to languages other than priority languages is set.

  1. Mark another page for translation and set one or more languages as priority langauge. Do not check the option Prevent translations to languages other than priority languages
  2. Translate the page and select a non-priority langauge.

Expected Behavior - A notice should appear stating that focus is on translating to the priority languages.

TC #4 - No notice is displayed when no priority languages are set

  1. Mark another page for translation without any priority language.
  2. Translate the page and select a langage other than the source language.

Expected Behavior - No notice should appear on the page.

Change 498306 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix improper notice when translating to non-priority language

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

abi_ removed a project: Patch-For-Review.

Moving to QA.

abi_ moved this task from QA to Done on the User-abi_ board.

This is done. Screenshots from meta.wikimedia,

Translating to non-priority language.

image.png (371×1 px, 48 KB)

Translating to priority language,

image.png (508×1 px, 56 KB)

Translating to non priority language, without Prevent translations to languages other than the priority languages set, set

image.png (416×1 px, 51 KB)

Translating to priority language, without Prevent translations to languages other than the priority languages set, set

image.png (492×1 px, 56 KB)