diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index dc90fa5..653ccbf 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -359,10 +359,7 @@ "Damage on impact": "攻击造成的伤害", 'Ability to evade an attack': '躲避攻击的能力', 'Chance of hitting': '躲避攻击的能力', - // '{$} energy per train': '每次锻炼花费{$}能量', - 'energy per train': '能量/次锻炼', - // 'energy per train': '每次锻炼花费5能量', - // 'energy per train': '每次锻炼花费50能量', + 'energy per train': ' 能量/次', 'Class:': '健身房类别:', "Membership cost:": "会员价格: ", "Energy usage:": "能量消耗: ", @@ -377,38 +374,62 @@ 'Unavailable': '不可用', "Middleweight": "中量级", "Lightweight": "轻量级", - 'per train': '能量/次', - '5 per train': '5能量/次', - '10 per train': '10能量/次', - '50 per train': '50能量/次', + '5 per train': '5 能量/次', + '10 per train': '10 能量/次', + '50 per train': '50 能量/次', + 'Bicep Curls': '二头肌弯举', + 'Cycling': '自行车', + 'Yoga': '瑜伽', + 'Press-ups': '俯卧撑', + 'Running': '跑步', + 'Karate': '空手道', + 'Catch': '', + 'Leg Curls': '腿部弯举', + 'Muay Thai': '泰拳', + "Woody's Slalom Sprint": '无敌回旋冲刺', + 'Frisbee': '飞盘', + 'Sit-ups': '仰卧起坐', + 'Wrestling': '摔跤', + 'Lateral Raises': '侧抬', + 'Interval Training': '间歇训练', + 'Judo': '柔道', + 'Balance Board': '平衡板', + 'Planking': '长板', + 'Kick Boxing': '跆拳道', + 'Zumba': '尊巴运动', + 'Chin-ups': '引体向上', + 'Jujitsu': '柔道', + 'Pilates': '普拉提', + 'Tricep-dips': '三头肌下蹲', + 'Sprint Training': '短跑训练', + 'Taekwondo': '跆拳道', + 'Squash': '壁球', + 'Squats': '深蹲', + 'Explosive Kettle Bell': '', + 'Darts': '飞镖', + 'Chest Flys': '', + 'Fartlek Training': '', + 'Badminton': '羽毛球', + 'Shoulder Shrugs': '肩部耸立', + 'Speedball': '迅速球', + 'Pool': '', + 'Chest Press': '胸部按压', + 'Skipping': '跳绳', + 'Batting': '', + 'Shoulder Press': '肩部推举', + 'Viper Belt Training': '', + 'Swimming': '游泳', + 'Bench Press': '卧推', + 'Agility Training Course': '', + 'Table Tennis': '敏捷性训练', + 'Suicide Running': '', + 'Aerobics': '有氧健身操', + 'Tricep Pulldowns': '三头肌下拉', + 'Incline Sprinting': '', + 'Basketball': '篮球', + 'Weighted Chin-ups': '负重引体向上', }; - const eduDict = { - 'Biology': '生物学', - 'Biology Modules': '生物学课程', - 'Introduction to Biochemistry': '生物化学概论', - 'You do not meet the requirements for this course. Please complete the prerequisites first.': - '你不符合本课程的要求。请先学习前置课程。', - 'Description:': '描述:', - 'Learning outcomes:': '学习后可获得:', - 'Prerequisites:': '前置课程:', - 'Parameters:': '课程参数:', - 'As the ultimate module - you will focus on maximum gym gain with the least amount of input.': '', - 'Ability to withdraw and deliver blood': '抽取和输送血液的能力(使用血包)', - 'Gain {$1} {$2} upon completion': '获得{$1}点{$2}', - 'intelligence': '智力(INT)', - 'endurance': '耐心(END)', - 'manual labor': '体力(MAN)', - '[Leave this course]': '[退出课程]', - 'You are taking the': '你正在学习', - 'education course.': '课程', - 'This course will be completed in': '该课程将完成于', - 'Strength and Conditioning': '力量和体能训练', - '[Leave course]': '[确认退出课程]', - 'Are you sure you want to leave the': '你确定你要退出', - 'course?': '课程吗?', - 'The current progress will be canceled and you\'ll have to start all over again.': '目前的进度将被取消,你将需要重新开始。', - }; const gymList = { 'Premier Fitness': '首席健身', 'Average Joes': '平衡乔伊', @@ -447,6 +468,32 @@ 'The Sports Science Lab': '运动科学实验室', 'The Jail Gym': '监狱健身房', }; + const eduDict = { + 'Biology': '生物学', + 'Biology Modules': '生物学课程', + 'Introduction to Biochemistry': '生物化学概论', + 'You do not meet the requirements for this course. Please complete the prerequisites first.': + '你不符合本课程的要求。请先学习前置课程。', + 'Description:': '描述:', + 'Learning outcomes:': '学习后可获得:', + 'Prerequisites:': '前置课程:', + 'Parameters:': '课程参数:', + 'As the ultimate module - you will focus on maximum gym gain with the least amount of input.': '', + 'Ability to withdraw and deliver blood': '抽取和输送血液的能力(使用血包)', + 'Gain {$1} {$2} upon completion': '获得{$1}点{$2}', + 'intelligence': '智力(INT)', + 'endurance': '耐心(END)', + 'manual labor': '体力(MAN)', + '[Leave this course]': '[退出课程]', + 'You are taking the': '你正在学习', + 'education course.': '课程', + 'This course will be completed in': '该课程将完成于', + 'Strength and Conditioning': '力量和体能训练', + '[Leave course]': '[确认退出课程]', + 'Are you sure you want to leave the': '你确定你要退出', + 'course?': '课程吗?', + 'The current progress will be canceled and you\'ll have to start all over again.': '目前的进度将被取消,你将需要重新开始。', + }; const headerDict = { "User's Name / ID": '用户名或ID', "Name": '用户名', @@ -509,7 +556,11 @@ 'ALL EVENTS (': '全部通知 (', 'RECEIVED (': '收到的通知 (', 'SAVED (': '保存的通知 (', - } + }; + const chatDict = { + 'Global': '世界', + 'Faction': '帮派', + }; /** * 边栏 @@ -684,6 +735,20 @@ * chatbox */ if ($('div#chatRoot').length > 0) { + const chatOB = new MutationObserver(_ => { + chatOB.disconnect(); + chatTrans(); + chatOB.observe($('div#chatRoot').get(0), {childList: true, subtree: true}); + }); + const chatTrans = function chatTrans() { + // 聊天框的标题 + $('div#chatRoot div[class^="chat-box-title"] span[class^="name"]').each((i, e) => { + if (chatDict[$(e).text().trim()]) + $(e).text(chatDict[$(e).text().trim()]); + }); + }; + chatTrans(); + chatOB.observe($('div#chatRoot').get(0), {childList: true, subtree: true}); } /** @@ -874,6 +939,10 @@ // 顶部提示信息 $('div[class^="notificationText"] p').contents().each((i, e) => { + if (e.nodeName === 'B' && gymList[$(e).text().trim()]) { + $(e).text(gymList[$(e).text().trim()]); + return; + } if (e.childNodes.length === 0 && gymDict[e.nodeValue.trim()]) e.nodeValue = gymDict[e.nodeValue.trim()]; }); @@ -923,6 +992,8 @@ $('div[class^="gymTitle"] h3').each((i, e) => { if (gymDict[$(e).text()]) $(e).text(gymDict[$(e).text()]); + else if (gymList[$(e).text().trim()]) + $(e).text(gymList[$(e).text().trim()]); }); // 健身房信息 属性名 $('ul[class^="gymInfo"] b').each((i, e) => { @@ -1377,7 +1448,7 @@ e.childNodes[1].firstChild.nodeValue = pos; e.childNodes[2].nodeValue = ' 名,'; if (isGainRacingPoint >= 0) { - e.childNodes[2].nodeValue += '获得' + racingPoint + '赛车点数(Racing Points)。'; + e.childNodes[2].nodeValue += '获得' + racingPoint + '赛车点数 (Racing Points)。'; } e.childNodes[2].nodeValue += '你的最佳圈速是 ' + bestLap;