Commit 651813b4 authored by antoor's avatar antoor

Multi-language support

多语言支持
parent 738085a7
......@@ -514,5 +514,13 @@ module.exports = {
update: {
title: 'Found updates',
body: (ver) => `New version: ${ver}`
},
viewsite: {
toolbar: {
save: 'Save',
view: 'View'
},
saveSuccess: 'Save cookie configuration is successful!',
saveFailed: (err) => `Save cookie configuration failed!\n${err}`
}
}
......@@ -482,5 +482,13 @@ module.exports = {
update: {
title: '发现更新',
body: (ver) => `新的版本:${ver}`
},
viewsite: {
toolbar: {
save: '保存',
view: '浏览'
},
saveSuccess: '保存Cookie成功!',
saveFailed: (err) => `保存Cookie失败!\n${err}`
}
}
......@@ -4,6 +4,8 @@
*/
const CookieMgr = require('./cookiemgr');
const LANG = antSword.language['viewsite'];
const LANG_T = antSword.language['toastr'];
class ViewSite {
constructor(opts) {
......@@ -49,9 +51,9 @@ class ViewSite {
_initToolbar() {
const toolbar = this.cell.attachToolbar();
toolbar.loadStruct([
{ id: 'save', type: 'button', icon: 'save', text: '保存' },
{ id: 'save', type: 'button', icon: 'save', text: LANG['toolbar'].save },
{ type: 'separator' },
{ id: 'view', type: 'button', icon: 'chrome', text: '浏览' },
{ id: 'view', type: 'button', icon: 'chrome', text: LANG['toolbar'].view },
]);
toolbar.attachEvent('onClick', (id) => {
switch(id) {
......@@ -133,9 +135,9 @@ class ViewSite {
conf: httpConf
});
if (ret === 1) {
toastr.success('保存Cookie成功!', '成功');
toastr.success(LANG['saveSuccess'], LANG_T['success']);
} else {
toastr.error('保存Cookie失败!' + ret, '失败');
toastr.error(LANG['saveFailed'](ret), LANG_T['error']);
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment