Page MenuHomePhabricator

[TUX] Can insert in translation editor from translation helper without translator rights
Closed, ResolvedPublic

Description

As a user without translator rights, it is possible to insert text from the translation helpers, even though the translation editor text area is read-only.

Steps to reproduce:

  1. Go to https://translatewiki.net/w/i.php?title=Special:Translate&group=ext-translate-0-all&language=fy&filter=!translated&action=translate as anonymous user
  2. Click a simple message

Observed:

  • Translation editor opens
  • Messaging is "You need permission to translate messages."
  • Textarea is read-only.

Continued steps:

  1. In the translation helper area, click "Use as translation" below "Beheer" (or whatever is suggested)

Observed:

  • String is inserted in editor, which remains read-only.

Expected:

  • Nothing should happen (or something else, but at least no string insertion in the editor).

Solutions

  • One way to fix this would be to update suggestionAdder in ext.translate.editor.helpers.js to check whether the textarea is readonly.
  • Add cursor: not-allowed for the section displaying Use as translation to avoid giving the user an impression that these are clickable.

Screenshot

image.png (625×1 px, 110 KB)

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:18 AM
bzimport set Reference to bz46557.
bzimport added a subscriber: Unknown Object (MLST).

Going to the URL above without being logged in, I get
"The indicated group does not exist. Select a different message group."

Any other URL where this problem can be tested?

I've updated the URL. The first string "Translate" can be used for step 2.

Wangombe changed the task status from Open to In Progress.Feb 15 2022, 10:58 AM
Wangombe claimed this task.

Change 764301 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Disable translation helper for user without rights

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

One can no longer insert a translate suggestion into the translation editor without translator rights. I have added

cursor: not-allowed

when a user attempts to click on a translation suggestion to give a cue that the action is not possible/allowed without logging in

Change 764301 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Disable translation helper for user without rights

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