From 35bd4bd77e799e00a50a388f9535cb8e3a84970a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=B1=E5=BD=A4?= Date: Sun, 14 Nov 2021 02:49:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=B5=81=E5=8A=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 48 +++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index d5a028f..4ec42b9 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1668,12 +1668,19 @@ "Crimes": "组织犯罪", "Membership": "成员资格", "has claimed sovereignty of": "", - "has abandoned": "弃用了", + "has abandoned": "放弃了地盘", "Achieved a chain of": "达成了连击链值", "and": "和", "respect [": "点声望 [", "deposited ${$1}": "存放了${$1}", - "Leadership was transferred to": "帮派领导权被移交给了 " + "Leadership was transferred to": "帮派领导权被移交给了 ", + "Someone mugged": "有人抢劫了 ", + "hospitalized": " 暴打了 ", + "mugged": " 抢劫了 ", + "attacked": " 攻击了 ", + "but lost": " 但是输了", + "Someone attacked": "有人攻击了 ", + "Someone hospitalized": "有人暴打了 " } function factionTrans() { @@ -1708,13 +1715,42 @@ $(e).text(factionDict[$(e).text().trim()]); } }) - //帮派主要消息日志 - $('ul[class^="news-list"] span[class^="info"]').contents().each((i, e) => { - if (factionDict[$(e).text().trim()]) { - e.nodeValue = e.nodeValue.replace($(e).text().trim(), factionDict[$(e).text().trim()]); + $('button[class^="tab"] ').each((i, e) => { + if ($(e).attr('class').indexOf("active") >= 0) { + console.log($(e).text()); + switch ($(e).text().trim()) { + case "主要消息": + $('ul[class^="news-list"] span[class^="info"]').contents().each((i, u) => { + if (factionDict[$(u).text().trim()]) { + u.nodeValue = u.nodeValue.replace($(u).text().trim(), factionDict[$(u).text().trim()]); + } + }) + break; + case "攻击": + $('ul[class^="news-list"] span[class^="info"]').find('*').contents().each((i, u) => { + console.log($(u).text().trim()) + if (factionDict[$(u).text().trim()]) { + u.nodeValue = factionDict[$(u).text().trim()]; + } + }) + break; + case "资金流动": + $('ul[class^="news-list"] span[class^="info"]').contents().each((i, u) => { + if (u.nodeValue) { + u.nodeValue = u.nodeValue.replace("deposited", "存放了"); + } + }) + break; + } } }) + // //帮派主要消息日志 + // $('ul[class^="news-list"] span[class^="info"]').contents().each((i, e) => { + // if (factionDict[$(e).text().trim()]) { + // e.nodeValue = e.nodeValue.replace($(e).text().trim(), factionDict[$(e).text().trim()]); + // } + // }) } From 4ae6ed51ac2f50c367f456ed9b01305b3de868f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=B1=E5=BD=A4?= Date: Sun, 14 Nov 2021 02:49:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=B5=81=E5=8A=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 4ec42b9..c2094a6 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Torn翻译 // @namespace WOOH -// @version 0.1.1113a +// @version 0.1.1113b // @description UI翻译 // @author Woohoo-[2687093] sabrina_devil[2696209] // @match https://www.torn.com/* From e68b23ec4d5fc8d60ee32e323df597f5efb9cdfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=B1=E5=BD=A4?= Date: Sun, 14 Nov 2021 02:51:47 +0800 Subject: [PATCH 3/3] version revised --- torn-trans-zhcn.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 31a96c5..0e71688 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Torn翻译 // @namespace WOOH -// @version 0.1.1113b +// @version 0.1.1114a // @description UI翻译 // @author Woohoo-[2687093] sabrina_devil[2696209] // @match https://www.torn.com/*