diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 34348d0..123608d 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -257,7 +257,7 @@ "At one point a Dual Wield Melee course was available at Torn City College for a fee of $50,000,000, but this was discontinued when Torn's citizens realized they were effectively paying to learn how to hold two things at once.": "托恩城市学院一度开设了双持近战课程,收费50,000,000美元,但当托恩的市民意识到他们实际上是在花钱学习如何同时持有两样东西时,这个课程就停止了。", }; - const cityDict = {//todo + const cityDict = { 'Map': '地图', 'Quick Links': '快速链接', 'Key of Symbols': '标志建筑', @@ -733,6 +733,7 @@ * city */ if (window.location.href.indexOf('city.php') >= 0) { + //todo 1.西部地区的健身房是否翻译? 2.bit's n bobs是否翻译? const cityOB = new MutationObserver(cityOBInit); function cityOBInit() { @@ -1258,8 +1259,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.