Greasy Fork is available in English.

Google翻译自动中英互译

自动切换输出语言

Ajankohdalta 2019-07-14 09:20:46 UTC. Katso uusin versio.

// ==UserScript==
// @name         Google翻译自动中英互译
// @description  自动切换输出语言
// @namespace    https://greasyfork.org/users/197529
// @author       kkocdko
// @license      Unlicense
// @version      0.4
// @include      *://translate.google.cn/*
// ==/UserScript==
'use strict';

function replaceUrlHash(selector, replaceValue) {
    location.hash = location.hash.replace(selector, replaceValue);
}
replaceUrlHash(/sl=en|sl=zh-CN/, 'sl=auto');
document.querySelector('.sl-selector a').addEventListener('DOMSubtreeModified', function() {
    replaceUrlHash(/tl=en|tl=zh-CN/, this.innerText == '检测到英语' ? 'tl=zh-CN' : 'tl=en');
});