修复逻辑错误

This commit is contained in:
woohoo 2021-11-06 01:22:29 +08:00
parent 4010b3e9db
commit f72f2cbf06

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Torn翻译
// @namespace WOOH
// @version 0.1.1105a
// @version 0.1.1106a
// @description UI翻译
// @author Woohoo-[2687093] sabrina_devil[2696209]
// @match https://www.torn.com/*
@ -180,39 +180,39 @@
'Info':'信息',
'Buy':'购买',
};
const travelingDict = { // todo jsonify
'Recruit Citizens': '招募玩家',
'Events': '事件',
'Torn to London.': '正在飞往英国伦敦London。',
'London to Torn.': '正从英国伦敦London回城。', // todo 所有目的地
'\nRemaining Flight Time -\n': ' 剩余时间 - ',
'Travel Home': "回国",
'Rehabilitation': "戒毒康复",
'People': "用户列表",
'Torn to Zurich.': '正在飞往瑞士苏黎世Zurich。',
'Zurich to Torn.': '正从瑞士苏黎世Zurich回城。',
};
// 界面tips todo 全收集全翻译
const tipsDict = {
'\nAccording to the Economist Intelligence Unit\'s Quality of Life Index, Switzerland is the second best place in the world to be born, after Denmark. Torn ranked 224th, despite there being only 194 recognised nations in the world.\t': "根据经济学人信息部提供的生活质量指数瑞士是世界上第二个最适合出生的地方仅次于丹麦。尽管世界上只有194个公认的国家但托恩却排名第224位。",
'\nThe opportunities for employment in Torn are wide and varied, from jobs in the zoo and the meat warehouse through to fantastic openings at the strip club - a description rarely used to refer to those who work there.\t':
"托恩的就业机会广泛而多样,从动物园和肉类仓库的工作,到脱衣舞俱乐部的奇妙开场--这是一个很少用来形容在那里工作的人的描述。",
'\nOne of the main requirements for a wedding to take place in Torn is the procurement of a ring. You may either purchase one from the Jewellery Store, or you can choose the more romantic option of stealing one, which requires far more effort if you think about it.\t': "在托恩举行婚礼的主要要求之一就是购买一枚戒指。你可以从珠宝店购买,也可以选择在偷窃戒指中选择一种很浪漫的方式,但是你冷静下来想想的话,这也是需要付出更大代价的。",
"\nDespite having no discernible court system Torn still employs several thousand people within its Judicial Services department. Nobody knows what the hell these people do all day, but if we had to guess, we'd say Solitaire.\t": "尽管没有明显的法院系统,托恩仍然在其司法服务部门雇用了几千人。没有人知道这些人整天都在做什么,但如果我们必须猜测,我们会说是接龙。",
"\nAt 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.\t": "托恩城市学院一度开设了双持近战课程收费50,000,000美元但当托恩的市民意识到他们实际上是在花钱学习如何同时持有两样东西时这个课程就停止了。"
};
titleTrans();
/**
* 飞行
*/
if (window.location.href.indexOf('index.php') >= 0 &&
$('.travelling h4').length !== 0) {
const travelingDict = { // todo jsonify
'Recruit Citizens': '招募玩家',
'Events': '事件',
'Torn to London.': '正在飞往英国伦敦London。',
'London to Torn.': '正从英国伦敦London回城。', // todo 所有目的地
'\nRemaining Flight Time -\n': ' 剩余时间 - ',
'Travel Home': "回国",
'Rehabilitation': "戒毒康复",
'People': "用户列表",
'Torn to Zurich.': '正在飞往瑞士苏黎世Zurich。',
'Zurich to Torn.': '正从瑞士苏黎世Zurich回城。',
};
// 界面tips todo 全收集全翻译
const tipsDict = {
'\nAccording to the Economist Intelligence Unit\'s Quality of Life Index, Switzerland is the second best place in the world to be born, after Denmark. Torn ranked 224th, despite there being only 194 recognised nations in the world.\t': "根据经济学人信息部提供的生活质量指数瑞士是世界上第二个最适合出生的地方仅次于丹麦。尽管世界上只有194个公认的国家但托恩却排名第224位。",
'\nThe opportunities for employment in Torn are wide and varied, from jobs in the zoo and the meat warehouse through to fantastic openings at the strip club - a description rarely used to refer to those who work there.\t':
"托恩的就业机会广泛而多样,从动物园和肉类仓库的工作,到脱衣舞俱乐部的奇妙开场--这是一个很少用来形容在那里工作的人的描述。",
'\nOne of the main requirements for a wedding to take place in Torn is the procurement of a ring. You may either purchase one from the Jewellery Store, or you can choose the more romantic option of stealing one, which requires far more effort if you think about it.\t': "在托恩举行婚礼的主要要求之一就是购买一枚戒指。你可以从珠宝店购买,也可以选择在偷窃戒指中选择一种很浪漫的方式,但是你冷静下来想想的话,这也是需要付出更大代价的。",
"\nDespite having no discernible court system Torn still employs several thousand people within its Judicial Services department. Nobody knows what the hell these people do all day, but if we had to guess, we'd say Solitaire.\t": "尽管没有明显的法院系统,托恩仍然在其司法服务部门雇用了几千人。没有人知道这些人整天都在做什么,但如果我们必须猜测,我们会说是接龙。",
"\nAt 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.\t": "托恩城市学院一度开设了双持近战课程收费50,000,000美元但当托恩的市民意识到他们实际上是在花钱学习如何同时持有两样东西时这个课程就停止了。"
};
titleTrans();
//如果在飞行页面
if ($('span.remaining-time').length !== 0) {
@ -340,6 +340,8 @@
*/
if (window.location.href.indexOf('index.php') >= 0 &&
$('h4#skip-to-content').text().indexOf('Home') >= 0) {
titleTrans();
let homeEvents = null;
$('h5.box-title').each((i, e) => {
@ -371,6 +373,7 @@
window.location.href.indexOf('personals.php') >= 0 ||
window.location.href.indexOf('bounties.php') >= 0 ||
window.location.href.indexOf('comics.php') >= 0) {
titleTrans();
let newspaperMenuOB = new MutationObserver(newspaperFunc);
const isOnBountyPage = window.location.href.indexOf('bounties.php') >= 0;
@ -408,6 +411,7 @@
* npc买房
*/
if (window.location.href.indexOf('estateagents.php') >= 0) {
titleTrans();
contentTitleLinksTrans();
return;
@ -420,6 +424,7 @@
const propertyOB=new MutationObserver(()=>{
propertyOB.disconnect();
titleTrans();
contentTitleLinksTrans();
// 黑框标题
@ -468,6 +473,7 @@
* 通知
*/
if (window.location.href.indexOf('events.php') >= 0) {
titleTrans();
let events;
const eventMutation = new MutationObserver(() => {
eventMutation.disconnect();