Google Translation Formatting

press F5

// ==UserScript==
// @name         Google Translation Formatting
// @namespace    https://translate.google.cn/*
// @version      0.4
// @description  press F5
// @author       quz
// @match        https://*translate.google.*/*
// @include      https://translate.google.*
// @grant        none
// ==/UserScript==

(function() {

    var txt = document.getElementById("source").value;
    //去除空格
    if(txt.indexOf("\n"))
    {
        txt = txt.replace(/\n/g," ");
    }

    //按句子分段
    if(txt.indexOf("."))
    {
        txt = txt.replace(/\. /g,".\n\n");
    }
    document.getElementById("source").value = txt;
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。