Page MenuHomePhabricator

It is not possible to add a link to the translation without selecting text and clicking on the source link
Closed, ResolvedPublic


Because the "Add link" control is never shown, even when the text caret is in an editable area, there is currently no way to add a link to the translation except by selecting text and clicking on a source link.

Event Timeline

Jsahleen raised the priority of this task from to Needs Triage.
Jsahleen updated the task description. (Show Details)
Jsahleen added subscribers: Aklapper, Jsahleen.
santhosh set Security to None.
santhosh added subscribers: Pginer-WMF, santhosh.

Removing technical-debt tag

As per the design, for adding link there must be a valid context and I don't think having caret in editable area is an enough context to show link tool.
@Pginer-WMF, please confirm.

I just tried the following:

  1. Type "Bratislava" in the translation.
  2. Select the text "Bratislava" in the translation.
  3. Observe that a link card with an "add link" action appears.
  4. Click on "add link"
  5. Observe that Bratislava turns into a link.

This seems a way to add a link without interacting with any source link.
Please, can you provide more details on the issue so that I can understand what is not working (examples and steps to reproduce would help)?


You can add a link by selecting text and using the link card as you noted. The issue I was trying to describe is when the text caret is in an editable area in the translation column but no text is selected and you click on a source link.

We need clarification on what should happen then. The options seems to be:

  1. Do nothing. Do not show the target link card.
  2. Show the target link card with "Add link" (if the link can be adapted)

In the second case, clicking on "Add link" would insert a new link at the caret position using the adapted title as the link text.


Steps to reproduce:

  1. Click on a placeholder to add a section to the translation column.
  2. Put the text caret somewhere in the translation section; not in link or template; do not select any text.
  3. Click on a source link
  4. Note add link control is not shown.

Should it be?

So if I have caret link like this "BBC ra|dio" and I click on a link in source column with title "BBC Radio", should we make the "radio" a link or "BBC Radio" as a whole as a link? We cannot decide it automatically right? That is what I meant, there is not enough context to create a link if you just place the caret somewhere.

This is disruptive too, users will have caret somewherer in editable area in translation section. If user want to click a source link and inspect what it is with the help of link cards, we are introducing an unexpected side effect, a link is inserted with some text in the caret position.

Curious - This bug was created based on the bugs you fixed inside the redlinks patch. Did you actually implement a fix for this in redlinks patch? If so how?

The point is to insert a link that uses the adapted title as the link text at the caret position; not to make the surrounding text a link. So in your example above, it would insert a link with the text "BBC Radio" wherever the text caret is. This would only be done by clicking "Add link." There would be no automatic link creation when clicking on a source link.

I did implement a fix for this in red links. Wasn't that hard given the above.

I think this can help translations for languages we don't support MT. But this also requires to do a good job on keeping the caret in place (or technically restoring it) when the user clicks on a source link (currently it seems to work when clicking on the source text but not when clicking on elements from the tools column). That is, when I see link cards shown as a result of clicking a source link, I should view where the caret is so that I expect where a new link is inserted if I click on "add link".

First, if there were text selected we should use that as a text (which I know is not the current case, but we need to make sue we don't interfere with that)

For the current case (no text selection in the translation):

  • When there is no MT we can use the article title in the target language.
  • When there is MT we can use an MT translation of the text (since it may have more context especifc info ("lemons" pointing to Lemon article). But it would not be a big problem if it just adds the target article title in that case. So we can start with that if it simplifies things.
Amire80 triaged this task as Medium priority.Jan 15 2015, 8:55 AM
Arrbee raised the priority of this task from Medium to High.Feb 2 2015, 8:13 AM
Arrbee moved this task from Needs Triage to Long term on the ContentTranslation board.
Arrbee lowered the priority of this task from High to Medium.Feb 2 2015, 9:24 AM
Arrbee subscribed.
Arrbee raised the priority of this task from Medium to Needs Triage.Feb 4 2015, 2:51 PM

I've looked into what implementing this would require. I think it wouldn't require more than a one day's worth of effort with minimal to moderate changes to the code. If we want to include in sprint 82, I can probably take it. However, it might be considered more of a new feature than a bug so I am also fine if we want to postpone in order to address higher priority issues.

Moving to Sprint 83 so it can be done along with the other link related tasks.

Amire80 lowered the priority of this task from Medium to Low.Mar 18 2015, 8:51 AM
Amire80 subscribed.
Amire80 renamed this task from It is not possible to add a link to the translation without selecting text and clicking on the source link. to It is not possible to add a link to the translation without selecting text and clicking on the source link.Jul 2 2015, 3:25 PM
Amire80 edited a custom field.
Amire80 claimed this task.

I just tried it and to the best of my understanding, it is resolved.

If there is a corresponding link, the clicking "Add link" adds text with the title of the corresponding article. This is correct and sensible.

Please reopen if I misunderstood anything.