Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
651813b4
Commit
651813b4
authored
Jul 01, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multi-language support
多语言支持
parent
738085a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
en.js
source/language/en.js
+8
-0
zh.js
source/language/zh.js
+8
-0
index.js
source/modules/viewsite/index.js
+6
-4
No files found.
source/language/en.js
View file @
651813b4
...
...
@@ -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
}
`
}
}
source/language/zh.js
View file @
651813b4
...
...
@@ -482,5 +482,13 @@ module.exports = {
update
:
{
title
:
'发现更新'
,
body
:
(
ver
)
=>
`新的版本:
${
ver
}
`
},
viewsite
:
{
toolbar
:
{
save
:
'保存'
,
view
:
'浏览'
},
saveSuccess
:
'保存Cookie成功!'
,
saveFailed
:
(
err
)
=>
`保存Cookie失败!\n
${
err
}
`
}
}
source/modules/viewsite/index.js
View file @
651813b4
...
...
@@ -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'
]
);
}
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment