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.