-
Notifications
You must be signed in to change notification settings - Fork 7
/
l10n.js
215 lines (169 loc) · 6.71 KB
/
l10n.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
let l10nEn = {
"geph": "Geph",
"cancel": "Cancel",
"errTitle": "Error",
"errUnexpected": "Unexpected error!",
"errCannotLogin": "Username or password incorrect!",
"errLogOut": "Log out",
"unameBox": "Username",
"pwordBox": "Password",
"loginBtn": "Login",
"registerBtn": "Register new account",
"captchaBox": "Verification",
"registerSubmit": "Register",
"unlimited": "Unlimited",
"registerTitle": "Register new account",
"registerSuccess": "Registration successful!\nYou may now log in with your new account.",
"errUserExists": "User already exists. Please choose another username.",
"errCaptchaIncorrect": "Verification code wrong. Please try again.",
"statusConnecting" : "Connecting...",
"statusConnected" : "<b class='text-success'>Connected</b> to the Geph network!",
"statusDisconnected": "Disconnected.",
"tooltipBrowser" : "Access blocked sites using your browser.",
"tooltipProxy": "Use the HTTP proxy localhost:8780.",
"ipLabel": "Public IP",
"connModeLabel": "Connection",
"connModeDirect": "Normal",
"connModeBackup": "Backup",
"balanceLabel": "Remaining data",
"remtimeLabel": "Remaining time",
"days": "days",
"planLabel": "Plan",
"planFree": "Free",
"speedLabel": "Transfer",
"connectBtn": "Connect",
"disconnectBtn": "Disconnect",
"settingsTitle": "Settings",
"autoconfigBrowser": "Automatically configure browsers",
"avoidChina": "Avoid proxying P.R. Chinese websites",
"langSelect": "Language",
"settingsDismiss": "Save settings",
"macPacMsg": "Geph requires your password the first time it is started in order to configure your network.",
"updateInfo": "A new version of Geph has been released! Please download it as soon as possible.",
"updateDownload": "Download",
"updateLater": "Later",
"upgradeblurb": "Unlimited bandwidth from $3.98/month!",
"managesub": "Manage subscription"
}
let l10nZht = {
"geph": "迷霧通",
"cancel": "取消",
"errTitle": "錯誤",
"errUnexpected": "異常錯誤",
"errCannotLogin": "用戶名或密碼不正確!",
"errLogOut": "登出",
"unameBox": "用戶名",
"pwordBox": "密碼",
"loginBtn": "登入",
"registerBtn": "建立帳戶",
"captchaBox": "驗證碼",
"registerSubmit": "確認",
"registerTitle": "建立新的帳戶",
"registerSuccess": "您的帳戶已成功建立!\n現在便可使用您的帳戶登入。",
"errUserExists": "該用戶名已有用戶使用。請輸入其他的用戶名。",
"errCaptchaIncorrect": "驗證碼錯誤。請重新輸入。",
"statusConnecting" : "正在連接...",
"statusConnected" : "<b class='text-success'>成功連接</b>至伺服器",
"statusDisconnected": "已斷開連接",
"tooltipBrowser" : "打開瀏覽器便可自由上網",
"tooltipProxy": "請用HTTP代理localhost:8780上網",
"ipLabel": "公網IP",
"connModeLabel": "連接模式",
"connModeDirect": "快速",
"connModeBackup": "備用",
"balanceLabel": "剩餘流量",
"remtimeLabel": "剩餘時間",
"days": "天",
"speedLabel": "當前速率",
"planLabel": "帳戶類型",
"planFree": "免費",
"unlimited": "無限",
"connectBtn": "連接",
"disconnectBtn": "斷開",
"settingsTitle": "設定",
"autoconfigBrowser": "自動設定瀏覽器代理",
"avoidChina": "不代理中國大陸網站",
"langSelect": "選擇語言",
"settingsDismiss": "保存設定",
"macPacMsg": "在第一次使用時,迷霧通需要您的密碼來更改您的網路設定。",
"updateInfo": "迷霧通已經更新到新的版本,請儘快下載",
"updateDownload": "下載",
"updateLater": "以後再說",
"upgradeblurb": "升級至無限流量,每月$3.98起",
"managesub": "管理帳戶"
}
let l10nZhs = {
"geph": "迷雾通",
"cancel": "取消",
"errTitle": "错误",
"errUnexpected": "异常错误",
"errCannotLogin": "用户名或密码不正确!",
"errLogOut": "登出",
"unameBox": "用户名",
"pwordBox": "密码",
"loginBtn": "登入",
"registerBtn": "建立帐户",
"captchaBox": "验证码",
"registerSubmit": "确认",
"registerTitle": "建立新的帐户",
"registerSuccess": "您的帐户已成功建立!\n现在便可使用您的帐户登入。",
"errUserExists": "该用户名已有用户使用。请输入其他的用户名。",
"errCaptchaIncorrect": "验证码错误。请重新输入。",
"statusConnecting" : "正在连接...",
"statusConnected" : "<b class='text-success'>成功连接</b>至服务器",
"statusDisconnected": "已断开连接",
"tooltipBrowser" : "打开浏览器便可自由上网",
"tooltipProxy": "请用HTTP代理localhost:8780上网",
"ipLabel": "公网IP",
"connModeLabel": "连接模式",
"connModeDirect": "快速",
"connModeBackup": "备用",
"balanceLabel": "剩余流量",
"remtimeLabel": "剩余时间",
"days": "天",
"speedLabel": "当前速率",
"planLabel": "帐户类型",
"planFree": "免费",
"unlimited": "无限",
"connectBtn": "连接",
"disconnectBtn": "断开",
"settingsTitle": "设定",
"autoconfigBrowser": "自动设定浏览器代理",
"avoidChina": "不代理中国大陆网站",
"langSelect": "选择语言",
"settingsDismiss": "保存设定",
"macPacMsg": "在第一次使用时,迷雾通需要您的密码来更改您的网络设定。",
"updateInfo": "迷雾通已更新到新的版本,请尽快下载",
"updateDownload": "下载",
"updateLater": "以后再说",
"upgradeblurb": "升级至无限流量,每月$3.98起",
"managesub": "管理帐户"
}
let l10n = l10nEn
function loadLang() {
// TODO make this configurable rather than resetting on start
if (!localStorage.getItem("gephpref.lang")) {
let sysLang = require("electron").remote.app.getLocale()
if (sysLang == "zh-TW" || sysLang == "zh-HK") {
localStorage.setItem("gephpref.lang", "zht")
} else if (sysLang == "zh-CN" || sysLang == "zh-SG "){
localStorage.setItem("gephpref.lang", "zhs")
} else {
localStorage.setItem("gephpref.lang", "en")
}
}
if (localStorage.getItem("gephpref.lang") == "zht") {
l10n = l10nZht
$("html").attr("lang", "zh-TW")
} else if (localStorage.getItem("gephpref.lang") == "zhs") {
l10n = l10nZhs
$("html").attr("lang", "zh-CN")
} else {
l10n = l10nEn
$("html").attr("lang", "en")
}
$("[data-l10n]").each(function(lol) {
$(this).html(l10n[$(this).data("l10n")])
})
}
$(document).ready(loadLang)