From 215c22435b485ec7010c1c446fae0e2f69dbbec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=B1=E5=BD=A4?= Date: Thu, 11 Nov 2021 18:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=AD=97=E5=85=B8=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=80=9A=E7=9F=A5=E9=80=89=E6=8B=A9=E6=A0=8F=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index ccf300b..ed8fde7 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1076,8 +1076,37 @@ * @param events */ function eventsTrans(events) { + + const eventsDict = { + "ALL EVENTS": "所有通知", + "RECEIVED": "收到的通知", + "SAVED": "已保存通知", + "Delete selected": "删除已选", + "Save selected": "保存已选", + "Check All": "勾选所有", + "Uncheck All": "取消勾选所有", + "Events": "通知", + "Log": "日志", + "Back": "返回", + "Recruit Citizens": "招募市民", + "Tutorial": "教程" + } + if (events.length === 0) return; events.each((i, e) => { + + /** 选择栏**/ + $('div[class^="mailbox-wrapper m-top10"] a[class^="btn torn-btn black"]').each((i, e) => { + let word = $(e).text().trim() + + if (word.indexOf("(") > 0) { + if (eventsDict[word.split(" (")[0]]) { + $(e).text($(e).text() + .replace(word.split(" (")[0], eventsDict[word.split(" (")[0]])); + } + } + }); + /** * 赛车 * You finished 5th in the Hammerhead race. Your best lap was 01:14.87.