Greasy Fork

Greasy Fork is available in English.

Default Google Translator Languages

Automatically selects the languages you want.

当前为 2024-06-06 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Default Google Translator Languages
// @namespace    http://greasyfork.icu/en/users/670188-hacker09?sort=daily_installs
// @version      1
// @description  Automatically selects the languages you want.
// @author       hacker09
// @match        https://translate.google.com/*
// @icon         https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://translate.google.com/&size=32
// @grant        GM_registerMenuCommand
// @grant        GM_getValue
// @grant        GM_setValue
// @run-at       document-start
// @noframes
// ==/UserScript==

(function() {
  'use strict';
  GM_registerMenuCommand("Save Current Settings", function(){ GM_setValue('Settings', location.href); }); //Adds an option to the tampermonkey menu
  if (window.location.search.match('tl=') === null && GM_getValue('Settings') !== undefined) { //If the current page doesn't have any language set
    location.href = GM_getValue('Settings'); //Set the default language
  } //Finishes the if condition
 })();