mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-01-12 22:27:09 +08:00
i18n translate
This commit is contained in:
@@ -70,6 +70,8 @@ exports.run = ->
|
||||
res.locals.config = app.config
|
||||
res.locals.t = res.t = app.i18n.getTranslator req
|
||||
|
||||
res.locals.config.web.name = res.t app.config.web.t_name
|
||||
|
||||
res.locals.selectHook = (name) ->
|
||||
return app.pluggable.selectHook req.account, name
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"common": {
|
||||
"error": "Error"
|
||||
},
|
||||
"account": {
|
||||
"account": {
|
||||
"": "Account",
|
||||
"signup": "Register",
|
||||
"login": "Login",
|
||||
@@ -24,7 +24,7 @@
|
||||
"panel": {
|
||||
"": "Control Panel"
|
||||
},
|
||||
"ticket": {
|
||||
"ticket": {
|
||||
"": "Support Tickets",
|
||||
"type": "Type",
|
||||
"title": "Title",
|
||||
@@ -39,7 +39,7 @@
|
||||
"finish_ticket": "Finish",
|
||||
"reopen_ticket": "Reopen"
|
||||
},
|
||||
"plan": {
|
||||
"plan": {
|
||||
"": "Plan"
|
||||
},
|
||||
"admin": {
|
||||
@@ -56,6 +56,5 @@
|
||||
}
|
||||
},
|
||||
"plugins": {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,88 +1,105 @@
|
||||
{
|
||||
"app": {
|
||||
"name": "RootPanel",
|
||||
"description": "一个插件化的 Linux 虚拟主机管理系统。"
|
||||
"app": {
|
||||
"name": "RootPanel",
|
||||
"description": "一个插件化的 Linux 虚拟主机管理系统。"
|
||||
},
|
||||
"plans": {
|
||||
"sample": {
|
||||
"name": "示例",
|
||||
"description": "每月 8 元,按小时计费"
|
||||
},
|
||||
"plans": {
|
||||
"sample": {
|
||||
"name": "示例",
|
||||
"description": "每月 8 元,按小时计费"
|
||||
},
|
||||
"test": {
|
||||
"name": "测试",
|
||||
"description": "按量付费,7 天不使用自动关闭"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"error": "错误",
|
||||
"success": "成功"
|
||||
},
|
||||
"languages": {
|
||||
"zh_CN": "简体中文",
|
||||
"en": "English",
|
||||
"auto": "自动"
|
||||
},
|
||||
"error_code": {
|
||||
"username_exist": "用户名已存在"
|
||||
"test": {
|
||||
"name": "测试",
|
||||
"description": "按量付费,7 天不使用自动关闭"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"error": "错误",
|
||||
"success": "成功",
|
||||
"save": "保存",
|
||||
"apply": "使用",
|
||||
"change": "修改"
|
||||
},
|
||||
"languages": {
|
||||
"zh_CN": "简体中文",
|
||||
"en": "English",
|
||||
"auto": "自动"
|
||||
},
|
||||
"error_code": {
|
||||
"username_exist": "用户名已存在"
|
||||
},
|
||||
"account": {
|
||||
"": "帐号",
|
||||
"register": "注册",
|
||||
"login": "登录",
|
||||
"username": "用户名",
|
||||
"email": "邮箱",
|
||||
"password": "密码",
|
||||
"logout": "注销",
|
||||
"preferences": "首选项"
|
||||
},
|
||||
"panel": {
|
||||
"": "管理面板",
|
||||
"overview": "概况"
|
||||
},
|
||||
"ticket": {
|
||||
"": "工单",
|
||||
"title": "标题",
|
||||
"status": "状态",
|
||||
"create": "创建",
|
||||
"reply": "回复",
|
||||
"replies": "全部回复",
|
||||
"create_ticket": "创建工单",
|
||||
"create_reply": "创建回复",
|
||||
"ticket_list": "工单列表",
|
||||
"close_ticket": "关闭",
|
||||
"finish_ticket": "完成",
|
||||
"reopen_ticket": "重新打开",
|
||||
"creator": "创建者",
|
||||
"members": "成员"
|
||||
},
|
||||
"plan": {
|
||||
"": "套餐",
|
||||
"subscribe": "订购",
|
||||
"unsubscribe": "退订",
|
||||
"balance": "余额",
|
||||
"remaining_time": "剩余时长",
|
||||
"currency": {
|
||||
"cny": "CNY"
|
||||
}
|
||||
},
|
||||
"admin": {
|
||||
"admin_panel": "管理员面板"
|
||||
},
|
||||
"time": {
|
||||
"day": "天"
|
||||
},
|
||||
"notification_title": {
|
||||
"ticket": "<%= title %> | 工单"
|
||||
},
|
||||
"view": {
|
||||
"layout": {
|
||||
"navigation": "展开导航"
|
||||
},
|
||||
"account": {
|
||||
"": "帐号",
|
||||
"register": "注册",
|
||||
"login": "登录",
|
||||
"username": "用户名",
|
||||
"email": "邮箱",
|
||||
"password": "密码",
|
||||
"logout": "注销"
|
||||
"password2": "重复",
|
||||
"already_register": "已有帐号?",
|
||||
"no_account": "还没有账户?",
|
||||
"password_inconsistent": "两次输入的密码不一致"
|
||||
},
|
||||
"panel": {
|
||||
"": "管理面板",
|
||||
"overview": "概况"
|
||||
},
|
||||
"ticket": {
|
||||
"": "工单",
|
||||
"title": "标题",
|
||||
"status": "状态",
|
||||
"create": "创建",
|
||||
"reply": "回复",
|
||||
"replies": "全部回复",
|
||||
"create_ticket": "创建工单",
|
||||
"create_reply": "创建回复",
|
||||
"ticket_list": "工单列表",
|
||||
"close_ticket": "关闭",
|
||||
"finish_ticket": "完成",
|
||||
"reopen_ticket": "重新打开",
|
||||
"creator": "创建者",
|
||||
"members": "成员"
|
||||
},
|
||||
"plan": {
|
||||
"": "套餐",
|
||||
"subscribe": "订购",
|
||||
"unsubscribe": "退订",
|
||||
"balance": "余额",
|
||||
"remaining_time": "剩余时长",
|
||||
"currency": {
|
||||
"cny": "CNY"
|
||||
}
|
||||
},
|
||||
"admin": {
|
||||
"admin_panel": "管理员面板"
|
||||
},
|
||||
"time": {
|
||||
"day": "天"
|
||||
},
|
||||
"notification_title": {
|
||||
"ticket": "<%= title %> | 工单"
|
||||
},
|
||||
"view": {
|
||||
"layout": {
|
||||
"navigation": "展开导航"
|
||||
},
|
||||
"account": {
|
||||
"password2": "重复",
|
||||
"already_register": "已有帐号?",
|
||||
"no_account": "还没有账户?",
|
||||
"password_inconsistent": "两次输入的密码不一致"
|
||||
}
|
||||
},
|
||||
"plugins": {}
|
||||
"preferences": {
|
||||
"options": "信息和偏好",
|
||||
"qq": "QQ",
|
||||
"coupon_code": "兑换代码",
|
||||
"code": "代码",
|
||||
"update_password": "修改密码",
|
||||
"old_password": "原密码",
|
||||
"new_password": "新密码",
|
||||
"repeat_password": "重复密码",
|
||||
"update_email": "修改邮箱",
|
||||
"current_email": "当前邮箱",
|
||||
"new_email": "新邮箱"
|
||||
}
|
||||
},
|
||||
"plugins": {}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ sample =
|
||||
|
||||
groups: ['root']
|
||||
|
||||
settings:
|
||||
preferences:
|
||||
avatar_url: 'http://ruby-china.org/avatar/efcc15b92617a95a09f514a9bff9e6c3?s=58'
|
||||
language: 'zh_CN'
|
||||
timezone: 'Asia/Shanghai'
|
||||
@@ -78,7 +78,7 @@ exports.register = (account, callback) ->
|
||||
|
||||
groups: []
|
||||
|
||||
settings:
|
||||
preferences:
|
||||
avatar_url: "//ruby-china.org/avatar/#{utils.md5(email)}?s=58"
|
||||
language: 'auto'
|
||||
timezone: config.i18n.default_timezone
|
||||
|
||||
@@ -138,7 +138,7 @@ exports.post '/update_email', requireAuthenticate, (req, res) ->
|
||||
, ->
|
||||
res.json {}
|
||||
|
||||
exports.post '/update_settings', requireAuthenticate, (req, res) ->
|
||||
exports.post '/update_preferences', requireAuthenticate, (req, res) ->
|
||||
modifiers =
|
||||
$set: {}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$ ->
|
||||
$('.action-save').click ->
|
||||
request '/account/update_settings/',
|
||||
request '/account/update_preferences/',
|
||||
qq: $('.form-setting .input-qq').val()
|
||||
, ->
|
||||
alert t 'common.success'
|
||||
@@ -1,68 +1,68 @@
|
||||
extends ../layout
|
||||
|
||||
prepend header
|
||||
title 个人信息 | #{config.web.name}
|
||||
title #{t('account.preferences')} | #{config.web.name}
|
||||
|
||||
block main
|
||||
.row
|
||||
header 信息设置
|
||||
header= t('view.preferences.options')
|
||||
form.form-setting.form-horizontal
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label QQ
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.qq')
|
||||
.col-sm-5
|
||||
input.input-qq.form-control(type='text', value=account.settings.qq)
|
||||
.form-group
|
||||
.col-sm-offset-3
|
||||
button.action-save.btn.btn-lg.btn-success(type='button') 保存
|
||||
button.action-save.btn.btn-lg.btn-success(type='button')= t('common.save')
|
||||
|
||||
.row
|
||||
header 兑换代码
|
||||
header= t('view.preferences.coupon_code')
|
||||
form.form-coupon.form-horizontal
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 代码
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.code')
|
||||
.col-sm-5
|
||||
input.input-coupon_code.form-control(type='text')
|
||||
.form-group
|
||||
.col-sm-offset-3
|
||||
button.action-use.btn.btn-lg.btn-success(type='button') 使用
|
||||
button.action-use.btn.btn-lg.btn-success(type='button')= t('common.apply')
|
||||
|
||||
.row
|
||||
header 修改密码
|
||||
header= t('view.preferences.update_password')
|
||||
form.form-password.form-horizontal
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 原密码
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.old_password')
|
||||
.col-sm-5
|
||||
input.input-old_password.form-control(type='password')
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 新密码
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.new_password')
|
||||
.col-sm-5
|
||||
input.input-password.form-control(type='password')
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 重复密码
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.repeat_password')
|
||||
.col-sm-5
|
||||
input.input-password2.form-control(type='password')
|
||||
.form-group
|
||||
.col-sm-offset-3
|
||||
button.action-update-password.btn.btn-lg.btn-info(type='button') 修改
|
||||
button.action-update-password.btn.btn-lg.btn-info(type='button')= t('common.change')
|
||||
|
||||
.row
|
||||
header 修改邮箱
|
||||
header= t('view.preferences.update_email')
|
||||
form.form-email.form-horizontal
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 当前邮箱
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.current_email')
|
||||
.col-sm-5
|
||||
input.form-control(value=account.email, disabled)
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 密码
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('account.password')
|
||||
.col-sm-5
|
||||
input.input-password.form-control(type='password')
|
||||
.form-group
|
||||
label.col-sm-2.col-md-offset-1.control-label 新邮箱
|
||||
label.col-sm-2.col-md-offset-1.control-label= t('view.preferences.new_email')
|
||||
.col-sm-5
|
||||
input.input-email.form-control(type='text')
|
||||
.form-group
|
||||
.col-sm-offset-3
|
||||
button.action-update-email.btn.btn-lg.btn-info(type='button') 修改
|
||||
button.action-update-email.btn.btn-lg.btn-info(type='button')= t('common.change')
|
||||
|
||||
|
||||
append footer
|
||||
@@ -36,7 +36,7 @@ html
|
||||
a(href='/panel/')= t('panel.')
|
||||
if app.models.mAccount.inGroup(account, 'root')
|
||||
li
|
||||
a(href='/admin/') 管理员面板
|
||||
a(href='/admin/')= t('admin.admin_panel')
|
||||
li
|
||||
a#logout(href='/account/logout/')= t('account.logout')
|
||||
else
|
||||
|
||||
@@ -45,9 +45,9 @@ block main
|
||||
prepend sidebar
|
||||
.row
|
||||
p
|
||||
a.btn.btn-lg.btn-success(href='/ticket/list/') 工单
|
||||
a.btn.btn-lg.btn-success(href='/ticket/list/')= t('ticket.')
|
||||
p
|
||||
a.btn.btn-lg.btn-success(href='/account/setting/') 首选项
|
||||
a.btn.btn-lg.btn-success(href='/account/preferences/')= t('account.preferences')
|
||||
|
||||
append footer
|
||||
script(src='/script/panel.js')
|
||||
|
||||
@@ -28,7 +28,7 @@ block main
|
||||
for reply in ticket.replies
|
||||
li.list-group-item.clearfix
|
||||
a.pull-left
|
||||
img(src= reply.account.settings.avatar_url)
|
||||
img(src= reply.account.preferences.avatar_url)
|
||||
.list-content
|
||||
p!= reply.content_html
|
||||
p
|
||||
@@ -63,7 +63,7 @@ prepend sidebar
|
||||
header= t('ticket.creator')
|
||||
li.list-group-item.clearfix
|
||||
a.pull-left
|
||||
img(src= ticket.account.settings.avatar_url)
|
||||
img(src= ticket.account.preferences.avatar_url)
|
||||
p
|
||||
span.label.label-info= ticket.account.username
|
||||
br
|
||||
@@ -73,7 +73,7 @@ prepend sidebar
|
||||
header= t('ticket.members')
|
||||
for member in ticket.members
|
||||
a.pull-left
|
||||
img(src= member.settings.avatar_url, alt= member.username)
|
||||
img(src= member.preferences.avatar_url, alt= member.username)
|
||||
|
||||
append footer
|
||||
script(src='/script/ticket/view.js')
|
||||
|
||||
92
package.json
92
package.json
@@ -1,49 +1,49 @@
|
||||
{
|
||||
"name": "rootpanel",
|
||||
"version": "0.8.0",
|
||||
"description": "A linux virtual host management system with extensibility",
|
||||
"homepage": "http://rpvhost.net",
|
||||
"license": "AGPL-3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jysperm/RootPanel.git"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "jysperm",
|
||||
"email": "jysperm@gmail.com",
|
||||
"url": "http://jysperm.me"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"start": "node start.js"
|
||||
},
|
||||
"bin": {
|
||||
"rp-fix-permissions": "./bin/rp-fix-permissions.coffee",
|
||||
"rp-system-sync": "./bin/rp-system-sync.coffee",
|
||||
"rp-migration": "./bin/rp-migration.coffee",
|
||||
"rp-clean": "./bin/rp-clean.coffee"
|
||||
},
|
||||
"dependencies": {
|
||||
"negotiator": "^0.4.8",
|
||||
"async": "^0.9.0",
|
||||
"coffee-script": "^1.7.1",
|
||||
"connect": "^2.17.3",
|
||||
"express": "^4.8.4",
|
||||
"harp": "^0.13.0",
|
||||
"jade": "^1.3.1",
|
||||
"markdown": "^0.5.0",
|
||||
"middleware-injector": "^0.1.1",
|
||||
"moment-timezone": "^0.2.2",
|
||||
"mongodb": "^1.4.8",
|
||||
"mysql": "^2.4.2",
|
||||
"nodemailer": "^1.2.1",
|
||||
"redis": "^0.12.1",
|
||||
"request": "^2.40.0",
|
||||
"tmp": "^0.0.24",
|
||||
"underscore": "^1.6.0",
|
||||
"json-stable-stringify": "^1.0.0",
|
||||
"counter-cache": "^0.1.0",
|
||||
"cookie-parser": "^1.3.3"
|
||||
"name": "rootpanel",
|
||||
"version": "0.8.0",
|
||||
"description": "A linux virtual host management system with extensibility",
|
||||
"homepage": "http://rpvhost.net",
|
||||
"license": "AGPL-3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jysperm/RootPanel.git"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "jysperm",
|
||||
"email": "jysperm@gmail.com",
|
||||
"url": "http://jysperm.me"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"start": "node start.js"
|
||||
},
|
||||
"bin": {
|
||||
"rp-fix-permissions": "./bin/rp-fix-permissions.coffee",
|
||||
"rp-system-sync": "./bin/rp-system-sync.coffee",
|
||||
"rp-migration": "./bin/rp-migration.coffee",
|
||||
"rp-clean": "./bin/rp-clean.coffee"
|
||||
},
|
||||
"dependencies": {
|
||||
"negotiator": "^0.4.8",
|
||||
"async": "^0.9.0",
|
||||
"coffee-script": "^1.7.1",
|
||||
"connect": "^2.17.3",
|
||||
"express": "^4.8.4",
|
||||
"harp": "^0.13.0",
|
||||
"jade": "^1.3.1",
|
||||
"markdown": "^0.5.0",
|
||||
"middleware-injector": "^0.1.1",
|
||||
"moment-timezone": "^0.2.2",
|
||||
"mongodb": "^1.4.8",
|
||||
"mysql": "^2.4.2",
|
||||
"nodemailer": "^1.2.1",
|
||||
"redis": "^0.12.1",
|
||||
"request": "^2.40.0",
|
||||
"tmp": "^0.0.24",
|
||||
"underscore": "^1.6.0",
|
||||
"json-stable-stringify": "^1.0.0",
|
||||
"counter-cache": "^0.1.0",
|
||||
"cookie-parser": "^1.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
3
plugin/rpvhost/locale/zh_CN.json
Normal file
3
plugin/rpvhost/locale/zh_CN.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"site_name": "RP 主机"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports =
|
||||
web:
|
||||
name: 'RP 主机'
|
||||
t_name: 'plugins.rpvhost.site_name'
|
||||
url: 'http://rpvhost.net'
|
||||
listen: '/home/rpadmin/rootpanel.sock'
|
||||
google_analytics_id: 'UA-49193300-2'
|
||||
|
||||
Reference in New Issue
Block a user