Open Priest-zhi opened 6 years ago
// ==UserScript== // @name Google translation replace character // @namespace https://translate.google.cn/ // @version 0.1 // @description press F5 // @author quz // @include https://translate.google./ // @match https://*translate.google./ // @grant none // ==/UserScript==
(function() { 'use strict'; //you can change what you want var txt = ""; 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;
})();
How to install https://greasyfork.org/zh-CN/scripts/370416-google-translation-formatting
// ==UserScript== // @name Google translation replace character // @namespace https://translate.google.cn/ // @version 0.1 // @description press F5 // @author quz // @include https://translate.google./ // @match https://*translate.google./ // @grant none // ==/UserScript==
(function() { 'use strict'; //you can change what you want var txt = "";
txt = document.getElementById("source").value; //去除空格 if(txt.indexOf("\n")) { txt = txt.replace(/\n/g," "); }
})();