This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlang.js
231 lines (227 loc) · 8.58 KB
/
lang.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
(function(){
var lang = window.location.search.substr(1)
if (["en","zh","zh-tw","ja"].indexOf(lang) < 0) {
lang = (navigator.browserLanguage ? navigator.browserLanguage : navigator.language).toLowerCase()
if (lang.indexOf("zh-tw") >= 0) lang = "zh-tw"
else if (lang.indexOf("zh") >= 0) lang = "zh"
else if (lang.indexOf("ja") >= 0) lang = "ja"
else if (navigator.languages != undefined) {
for (var i = 0; i < navigator.languages.length; ++i) {
if (navigator.languages[i].toLowerCase().indexOf("zh-tw") >= 0) {
lang = "zh-tw"
break
}
if (navigator.languages[i].indexOf("zh") >= 0) {
lang = "zh"
break
}
if (navigator.languages[i].indexOf("ja") >= 0) {
lang = "ja"
break
}
if (navigator.languages[i].indexOf("en") >= 0) break
}
if ((lang != "zh") && (lang != "ja")) lang = "en"
}
}
if (lang == "zh") {
document.title = "舰队Collection 开发工具"
$(function(){document.body.lang = "zh"})
dict = { "KanColle Development Tools": "舰队Collection 开发工具",
"Development Simulator & Recipe Generator": "开发模拟器 & 复合公式生成器",
"Development Simulator": "开发模拟器",
"Recipe Generator": "复合公式生成器",
"Probability Table": "概率一览表",
"Fuel": "油",
"Ammunition": "弹",
"Ammu": "弹",
"Steel": "钢",
"Bauxite": "铝",
"Dev. Mat.": "开发资材",
"Secretary": "秘书舰",
"HQ Level": "提督等级",
"Torpedo Family": "水雷系",
"Gunboat Family": "炮舰系",
"Carrier Family": "航母系",
"Require": "需要",
"Min ": "最低",
"No Result": "无结果",
"Details": "详细",
"Expected Resource Consumption": "期望出货消耗",
"Get Target": "出货",
"Develop": "开发",
"Success Rate": "成功率",
"Failure Rate": "失败率",
"Name": "名称",
"Percentage": "概率",
"Failed": "失败",
"Internal": "内部",
"Rarity": "稀有度",
"(\\d{1,2}%) when (.*?) is available": "$2 加入列表时为 $1",
"Only available when<br ?/?>material is greater than<br ?/?>([0-9\\/]*)": "仅资源投入达到\n$1\n时加入列表",
" ?Italian Flagship": "意舰旗舰",
"No records for Luigi Torelli and Aquila": "Luigi Torelli、Aquila 无出货记录",
"Project Homepage": "项目页面",
"Feedback": "反馈",
"Data Source\\(Chinese\\)": "数据来源",
'The original author has stopped maintenance\\.<br ?/?>It is recommended to use the version maintained by SkywalkerJi: <a href="https://御坂美琴\\.cn/kc-development-tools/">https://御坂美琴\\.cn/kc-development-tools/</a>': '原作者已停止维护。<br>建议使用SkywalkerJi维护的版本:<a href="https://御坂美琴.cn/kc-development-tools/">https://御坂美琴.cn/kc-development-tools/</a>' }
itemtypenames = [ "小口径主炮",
"中口径主炮",
"大口径主炮",
"副炮",
"机枪",
"对空强化弹",
"穿甲弹",
"鱼雷 & 微型潜艇",
"舰载战斗机",
"舰载鱼雷机",
"舰载轰炸机",
"舰载侦查机",
"水上机",
"电探",
"对潜装备",
"引擎",
"增设装甲板",
"陆基攻击机",
"简易运输桶" ]
} else if (lang == "zh-tw") {
document.title = "艦隊Collection 開發工具"
$(function(){document.body.lang = "zh-tw"})
dict = { "KanColle Development Tools": "艦隊Collection 開發工具",
"Development Simulator & Recipe Generator": "開發模擬器 & 複合公式生成器",
"Development Simulator": "開發模擬器",
"Recipe Generator": "複合公式生成器",
"Probability Table": "概率一覽表",
"Fuel": "燃",
"Ammunition": "彈",
"Ammu": "彈",
"Steel": "鋼",
"Bauxite": "鋁",
"Dev. Mat.": "開發資材",
"Secretary": "秘書艦",
"HQ Level": "提督等級",
"Torpedo Family": "水雷系",
"Gunboat Family": "炮艦系",
"Carrier Family": "航母系",
"Require": "需要",
"Min ": "最低",
"No Result": "無結果",
"Details": "詳細",
"Expected Resource Consumption": "期望出貨消耗",
"Get Target": "出貨",
"Develop": "開發",
"Success Rate": "成功率",
"Failure Rate": "失敗率",
"Name": "名稱",
"Percentage": "概率",
"Failed": "失敗",
"Internal": "内部",
"Rarity": "稀有度",
"(\\d{1,2}%) when (.*?) is available": "$2 加入列表時為 $1",
"Only available when<br ?/?>material is greater than<br ?/?>([0-9\\/]*)": "僅資源投入達到\n$1\n時加入列表",
" ?Italian Flagship": "意艦旗艦",
"No records for Luigi Torelli and Aquila": "Luigi Torelli、Aquila 無出貨記錄",
"Project Homepage": "項目頁面",
"Feedback": "反饋",
"Data Source\\(Chinese\\)": "數據來源",
'The original author has stopped maintenance\\.<br ?/?>It is recommended to use the version maintained by SkywalkerJi: <a href="https://御坂美琴\\.cn/kc-development-tools/">https://御坂美琴\\.cn/kc-development-tools/</a>': '原作者已停止維護。<br>建議使用SkywalkerJi維護的版本:<a href="https://御坂美琴.cn/kc-development-tools/">https://御坂美琴.cn/kc-development-tools/</a>' }
itemtypenames = [ "小口徑主砲",
"中口徑主砲",
"大口徑主砲",
"副砲",
"機槍",
"對空強化彈",
"穿甲彈",
"魚雷 & 微型潛艇",
"艦載戰鬥機",
"艦載魚雷機",
"艦載轟炸機",
"艦載偵查機",
"水上機",
"電探",
"對潛裝備",
"引擎",
"增設裝甲板",
"陸基攻擊機",
"簡易運輸桶" ]
} else if (lang == "ja") {
document.title = "艦これ 装備開発ツール"
$(function(){document.body.lang = "ja"})
dict = { "KanColle Development Tools": "艦これ 装備開発ツール",
"Development Simulator & Recipe Generator": "開発シミュレータ&複合レシピジェネレータ",
"Development Simulator": "開発シミュレータ",
"Recipe Generator": "複合レシピジェネレータ",
"Probability Table": "確率一覧表",
"Fuel": "燃料",
"Ammunition": "弾薬",
"Ammu": "弾薬",
"Steel": "鋼材",
"Bauxite": "ボーキ",
"Dev. Mat.": "開発資材",
"Secretary": "秘書艦",
"HQ Level": "司令部LV",
"Torpedo Family": "水雷系",
"Gunboat Family": "砲戦系",
"Carrier Family": "空母系",
"Min ": "最低",
"No Result": "結果がない",
"Details": "詳細",
"Expected Resource Consumption": "予想した資源の使用量",
"Get Target": "目安を入手",
"Develop": "開発",
"Success Rate": "成功率",
"Failure Rate": "失敗率",
"Name": "名称",
"Percentage": "確率",
"Failed": "失敗",
"Internal": "内部の",
"Rarity": "レア度",
"(\\d{1,2}%) when (.*?) is available": "$2 が出る時の確率は $1",
"Only available when<br ?/?>material is greater than<br ?/?>([0-9\\/]*)": "材料使用量が\n$1\n以上の場合のみ",
"Require Italian Flagship": "イタリア艦を秘書艦に\n任命する必要があります",
"Require(<br ?/?>| )([\\w\\W]*)": "$2$1を必要とする",
"Italian Flagship": "イタリア艦を秘書艦に任命する",
"No records for Luigi Torelli and Aquila": "Luigi Torelli と Aquila に関する記録はありません",
"Project Homepage": "ホームページへ",
"Feedback": "フィードバック",
"Data Source\\(Chinese\\)": "データのソース(中国語)",
'The original author has stopped maintenance\\.<br ?/?>It is recommended to use the version maintained by SkywalkerJi: <a href="https://御坂美琴\\.cn/kc-development-tools/">https://御坂美琴\\.cn/kc-development-tools/</a>': '原作者はメンテナンスを停止しています。<br>SkywalkerJi によって維持されているバージョンを使用することをお勧めします:<a href="https://御坂美琴.cn/kc-development-tools/">https://御坂美琴.cn/kc-development-tools/</a>' }
itemtypenames = [ "小口径主砲",
"中口径主砲",
"大口径主砲",
"副砲",
"対空機銃",
"対空強化弾",
"対艦強化弾",
"魚雷 & 特殊潜航艇",
"艦上戦闘機",
"艦上攻撃機",
"艦上爆撃機",
"艦上偵察機",
"水上機",
"レーダー",
"ソナー & 爆雷",
"機関部強化",
"増設バルジ",
"陸上攻撃機",
"簡易輸送部材" ]
} else $(function(){document.body.lang = "en"})
document.addEventListener('DOMContentLoaded', function() {
var $cs = $(".i18n")
for (var i = 0; i < $cs.length; ++i) $cs[i].innerHTML = getString($cs[i].innerHTML)
$cs = $(".notice")
for (var i = 0; i < $cs.length; ++i) $cs[i].title = getString($cs[i].title)
$("#lang").find("[value=" + lang + "]")[0].selected = true
$("#lang")[0].onchange = function() {
location.href = "?" + $("#lang")[0].selectedOptions[0].value + window.location.hash
}
})
}())
var dict
function getString(src) {
if (dict == undefined) return src
for (var name in dict) {
src = src.replace(new RegExp(name, "g"), dict[name])
}
return src
}