Page MenuHomePhabricator

Provide a "copy content" button in Special:Translate
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
Trizek-WMF
Jun 28 2022, 2:43 PM
Referenced Files
F48464440: Screenshot 2024-04-24 at 17-26-02 Fordítás – Meta.png
Wed, Apr 24, 3:28 PM
F48454991: image.png
Wed, Apr 24, 2:03 PM
F48454938: image.png
Wed, Apr 24, 2:03 PM
F48318935: image.png
Tue, Apr 23, 6:36 PM
F48318912: image.png
Tue, Apr 23, 6:36 PM
F47347378: copy-source-translate-v2.mp4
Thu, Apr 18, 2:49 PM
F47347206: image.png
Thu, Apr 18, 2:49 PM
F46945704: copy-source-translate.mp4
Tue, Apr 16, 8:43 AM

Description

As a translator, I use external tools (in my case DeepL) to ease my translation work.

At the moment, as my favorite transaltion service is not available, I have to manually copy the contents to my external tool. My steps are:

  1. select the text
  2. copy it (though keyboard shortcuts, or pointer shortcuts)
  3. paste it to my translation engine

Repeating this process for each translation unit is time consuming and a bit boring.

As Special:Translate tool offers to "Paste the source text", could we have a "Copy the source text" that would copy it? Users would just have to paste it to their favorite translation tool.

(Inspiration taken from DeepL: they provide a copy button for the translated text.)

(Apologies if this task is a duplicate.)

Event Timeline

Trizek-WMF renamed this task from Provide a "copy content" in Special:Translate to Provide a "copy content" button in Special:Translate.Jun 28 2022, 2:43 PM
Pginer-WMF moved this task from Backlog to tux on the MediaWiki-extensions-Translate board.

When I was reviewing other localisation platforms, I noticed that some of them like Weblate have a small toolbox in the translation editor.

See: https://docs.weblate.org/en/latest/_images/plurals.png

Something like this could also be added for this feature.

Change #1019714 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Tux editor: Add copy source text button

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

I've added the "Copy" button next to the source text. Its only visible when the user hovers over the source text or tabs to select it.

Its only visible when the user hovers over the source text or tabs to select it.

Perhaps it should always be visible. I assume it's not because not all translators follow the use of external tools such as described in the ticket. I wouldn't find it distracting to always have it in view nonetheless.

Its only visible when the user hovers over the source text or tabs to select it.

Perhaps it should always be visible. I assume it's not because not all translators follow the use of external tools such as described in the ticket. I wouldn't find it distracting to always have it in view nonetheless.

The reason I did not make it always visible was because it tends to cover up the content.

The reason I did not make it always visible was because it tends to cover up the content.

With the button now moved to the top, a simple float:right instead of absolute positioning would solve the covering problem. However, …

I wouldn't find it distracting to always have it in view nonetheless.

…I think I would.

After discussion with @Pginer-WMF, we've decided to add the button next to the message title and the button only appears when the source text is hovered on.

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

Video:

Sorry for being nitpicking, but I don’t like this position either: I’d think it copies the message ID (which would also make sense), not the original text.

Sorry for being nitpicking, but I don’t like this position either: I’d think it copies the message ID (which would also make sense), not the original text.

I had misunderstood Pau. I reverted to the old design and improved the alignment which is what Pau actually meant.

image.png (452×842 px, 36 KB)

image.png (456×523 px, 7 KB)

Sorry for being nitpicking, but I don’t like this position either: I’d think it copies the message ID (which would also make sense), not the original text.

Do you think it'll be helpful to have a copy button that copies the message ID?

I had misunderstood Pau. I reverted to the old design and improved the alignment which is what Pau actually meant.

Thanks, this looks good!

Do you think it'll be helpful to have a copy button that copies the message ID?

I often copy the message ID, but not always the same part of it. If I’m translating a MediaWiki message on Translatewiki, and I want to…

  • …point out an issue to a fellow translator into a same language, I need the full page name (MediaWiki:Foo/qqx).
  • …look it up in my home wiki, I need the namespaced base page name (MediaWiki:Foo).
  • …grep for it in the Git repo, I need the base page name without namespace and with the first letter lowercased (foo).

I’m not sure how useful it would be if it couldn’t read my mind and figure out what I need at the moment (which it obviously can’t).

I made some more tweaks based on discussion with Pau to align the copy button with the X icon always. This ensures that the copy button never overlaps the text.

image.png (428×1 px, 43 KB)

image.png (362×1 px, 34 KB)

I made some more tweaks based on discussion with Pau to align the copy button with the X icon always.

Thanks, it looks even better!

This ensures that the copy button never overlaps the text.

I don’t think it does. It never overlaps when the documentation/translation helpers pane is open, because it happens to be in the place reserved for the arrow; but I’m pretty sure it can overlap when the pane is closed. This is how the pane looks currently like in production (Meta):

Screenshot 2024-04-24 at 17-26-02 Fordítás – Meta.png (390×1 px, 53 KB)

The message definition runs all the way to the right border (it has even less padding than on the left-hand side).

Change #1019714 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Tux editor: Add copy source text button

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

Deployed on translatewiki.net