bpierre / gtranslate

Translate the selected text using Google Translate.
https://addons.mozilla.org/firefox/addon/gtranslate/
Mozilla Public License 2.0
95 stars 27 forks source link

Add copy to the clipboard #73

Closed fluks closed 8 years ago

fluks commented 8 years ago

Add a menuitem under the result for copying the translation to the clipboard.

Fixes issue #61.

There might be a bug, which manifests itself when the result's label is LABEL_LOADING the first time. The copy menuitem is not disabled, I don't know why.

bpierre commented 8 years ago

Thanks for looking into this. I just tried, it disable the ability to click on the translation to open the Google Translate page. What about moving it below the translation result?

fluks commented 8 years ago

Adding the copy menuitem below the translation looks slightly confusing to me. Not much but just a little. What if I add an icon onto it or put it below the menuseparator? Or both.

Which one of these is the best?

PerfectSlayer commented 8 years ago

I vote for the last one. But complete the menu item label with « Copy translation » to help user to understand the feature.

fluks commented 8 years ago

Yes, maybe it's better to be explicit.

bpierre commented 8 years ago

Thanks @fluks!

I agree, “Copy translation” is better, another reason is that it visually fits better with the width of the result menu.

About the icon: I think it needs to match the normal “copy” menu entry. For example, it’s not present on OS X and Ubuntu 16.04 / Unity 7, so I don’t think we should add one. Is there a way to get the platform “copy” icon from the SDK?

About the separator, I was trying to think about the meaning of the separator:

We could think of the two groups as a “translation result group” and a “quick settings group”, the latter one containing the quick language change that need to be added - #22 #52. In this case, it makes more sense to add it above the separator.

But we could also think of these two groups as a way to separate the translation result (which is a very unusual kind of menu entry) from everything else. In this case, the copy entry need to be moved below the separator.

Now, the menu can always be rearranged later, and the last proposal (below the separator) would get my vote today.

fluks commented 8 years ago

On Kubuntu, Plasma 5, there is an icon on the copy menu entry. Firefox uses GTK on linux, so I guess the appearance of the icon, or its existence, depends on the GTK theme. I tried to look for platform icons in the SDK, but no luck so far.

Ok, below it is.

PerfectSlayer commented 8 years ago

About the icon, no icon neither on Windows 10.

About the two groups and the separator, I voted below because I would prefer the second kind of separation that @bpierre describes: keep actions and options separate from translations.

bpierre commented 8 years ago

Tested, looks good to me! ✨