Skip to content

Google Translate - Copy Button First! by rainslide

Screenshot of Google Translate - Copy Button First!

Details

Authorrainslide

LicenseAGPL-3.0-or-later

Categorytranslate.google.com

Created

Updated

Size1.2 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Move the "Copy translation" button to the start, alone with or exchange with the "Listen" button.

Notes

The "Copy translation" button can copy the translations within one click, or you mis-click on the Rate / Share button and wasted. This style can fix this by moving the Copy button to the other side.

Source code

/* ==UserStyle==
@name         Google Translate - Copy First!
@description  Move the "Copy translation" button to the start, alone with or exchange with the "Listen" button.
@namespace    RainSlide
@author       RainSlide
@version      1.0.0
@license      AGPL-3.0-or-later
@var checkbox move-listen 'Move The "Listen" button' 0
==/UserStyle== */

@-moz-document domain("translate.google.com") {

	c-wiz[jsname][role="region"]:has(> h2:first-child) /* <c-wiz> */
	  div[jsaction][jscontroller][jslog] > h3:first-child
	~ div[jsname][jsaction^="copy"]:last-child
	> div[jsaction][jscontroller]:only-child /* Translation results */
	> div[jsaction]:last-child               /* The buttons */
	{
		/* Add some space between translation and action buttons */
		padding-top: 2px;
		
		> div:first-child {
			margin-right: auto;
		}

		/* Container for the "Copy translation" button */
		> div:last-child {
			display: contents;

			/* The "Copy translation" button */
			> span[data-is-tooltip-wrapper="true"]:not([class]) {
				order: -1;
				/* flex-grow: 1 > margin-right: auto */
				flex-grow: var(--move-listen);
			}
		}

	}

}

Reviews

No reviews yet.