Page MenuHomePhabricator

Prevent from selecting the same source and target languages in new translation dialog
Closed, ResolvedPublic1 Story Points

Description

It should not be possible to select the same language as source and target. Currently you can change the source to the same language the target is:

At the ongoing translations you can see a Bulgatian-to-Bulgarian translation probably started because of this bug.

The way it used to work (and how it should) is:

  • If you have (Source: X, Target: Y), and Target is changed to X the result is (Source: Y, Target: X).
  • If you have (Source: X, Target: Y), and Source is changed to Y the result is (Source: Y, Target: X).

That is, trying to select the same language becamoes a shortcut to switch source and target languages.

Given that this was working previously, it may be a good idea to write some tests that prevent future regressions.

Event Timeline

Pginer-WMF raised the priority of this task from to Needs Triage.
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF added a subscriber: Pginer-WMF.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 20 2015, 4:41 PM
Arrbee triaged this task as Low priority.Apr 21 2015, 8:54 AM
Arrbee edited a custom field.
Amire80 claimed this task.Apr 21 2015, 9:49 AM
Amire80 added a subscriber: Amire80.

Closely related to T94869, i'll do them together.

Arrbee moved this task from Backlog to In Progress on the LE-Sprint-86 board.May 6 2015, 7:25 AM
Amire80 moved this task from In Progress to In Review on the LE-Sprint-86 board.May 6 2015, 7:51 PM

Change 209315 had a related patch set uploaded (by Amire80):
Don't let source and target languages be the same

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

Change 209315 merged by jenkins-bot:
Don't let source and target languages be the same

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

Amire80 reassigned this task from Amire80 to Pginer-WMF.May 18 2015, 9:28 AM
Amire80 removed a project: Patch-For-Review.

@Pginer-WMF, can you please test that it's good now?

@Pginer-WMF, can you please test that it's good now?

It works well in general but there is a problem with languages that are only partially supported (e.g., supported as source but not as target).
For example if the default choice is "English -> Spanish", and I switch the source language to be Spanish, the result shown is "Spanish -> English" which we don't support since English is not yet available as a target language. In that context, we can either (a) show English as disabled when it appears as a target language, or (b) just replace English with another valid target language (Simple English could be a good default).

In the long term, when all languages can be used as source and target, this should not be an issue.

Arrbee added a subscriber: Arrbee.May 25 2015, 8:06 AM

Timeboxed to EOD 26th May 2015

Arrbee reassigned this task from Pginer-WMF to Amire80.May 25 2015, 8:06 AM

Change 214019 had a related patch set uploaded (by Amire80):
Prevent swapping to an invalid target language

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

Change 214019 merged by jenkins-bot:
Prevent swapping to an invalid target language

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

Can this be closed?

Arrbee closed this task as Resolved.Jun 9 2015, 8:09 AM
Arrbee moved this task from In Review to Done on the LE-Sprint-86 board.