NEZ-1220 fix:setup界面国际化
This commit is contained in:
@@ -2,12 +2,12 @@ import Vue from 'vue'
|
||||
import locale from 'element-ui/lib/locale'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import { get } from '@/http'
|
||||
// import messages from './language'
|
||||
import messages from './language'
|
||||
Vue.use(VueI18n)
|
||||
// 从localStorage获取语言选择。
|
||||
const i18n = new VueI18n({
|
||||
locale: localStorage.getItem('nz-language') || 'en' // 初始未选择默认 en 英文
|
||||
// messages
|
||||
locale: localStorage.getItem('nz-language') || 'en', // 初始未选择默认 en 英文
|
||||
messages
|
||||
})
|
||||
locale.i18n((key, value) => i18n.t(key, value)) // 兼容element
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import en from './en'
|
||||
import cn from './cn'
|
||||
import newen from './newen'
|
||||
import newcn from './newcn'
|
||||
export default {
|
||||
en: en,
|
||||
cn: cn
|
||||
en: newen,
|
||||
cn: newcn
|
||||
}
|
||||
|
||||
70
nezha-fronted/src/components/common/language/newcn.js
Normal file
70
nezha-fronted/src/components/common/language/newcn.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN' // 引入element语言包
|
||||
const newcn = {
|
||||
setup: {
|
||||
step0: '欢迎',
|
||||
step1: '数据库',
|
||||
step2: 'Redis',
|
||||
step3: '系统',
|
||||
host: 'Host',
|
||||
port: '端口',
|
||||
language: '语言',
|
||||
welcome: {
|
||||
header: '欢迎使用哪吒安装向导!',
|
||||
guid: '向导将为您做什么?',
|
||||
guid_1: '创建基本的配置',
|
||||
guid_2: '尝试在数据库和Redis设置中查找问题',
|
||||
toContinue: '继续',
|
||||
creatFile: '出于安全原因,您需要通过创建文件来验证安装',
|
||||
createFileTip: '这可以通过执行以下命令来完成',
|
||||
next: '完成后单击“下一步”按钮.'
|
||||
},
|
||||
database: {
|
||||
configTitle: '配置数据库连接',
|
||||
configTip: '请手动创建数据库,并设置连接到此数据库的配置参数,完成后按“下一步”按钮'
|
||||
},
|
||||
redis: {
|
||||
configTitle: '配置Redis连接',
|
||||
configTip: '请设置连接到此redis的配置参数,完成后按“下一步”按钮'
|
||||
},
|
||||
system: {
|
||||
configTitle: '系统配置',
|
||||
configTip: '请输入管理员的用户名和密码,并设置Nezha WEB模块的安装信息,如IP:port',
|
||||
federation: '联邦',
|
||||
federationEnable: '可用',
|
||||
federationDisable: '不可用'
|
||||
},
|
||||
name: '数据库名称',
|
||||
username: '用户名',
|
||||
pin: '密码',
|
||||
alertPath: '网站URL',
|
||||
alertPrefix: '警报前缀',
|
||||
haMode: 'HA 模式',
|
||||
haVip: '虚拟的 IP',
|
||||
next: '下一步',
|
||||
back: '返回',
|
||||
finish: '完成',
|
||||
invalidDb: '数据库配置可能存在一些错误',
|
||||
invalidRedis: 'Redis的配置可能有一些错误',
|
||||
invalidPin: 'Redis的密码可能错误',
|
||||
requirePin: 'Redis可能需要密码',
|
||||
wait: '配置已保存,请耐心等待生效',
|
||||
reloadTimeout: '重新启动服务器花了太多时间,安装可能有一些问题',
|
||||
hadConfig: '已经有人开始配置系统',
|
||||
invalidCode: '身份验证无效,请按照{page}中的描述继续',
|
||||
welcomePage: '欢迎页面',
|
||||
inited: '系统已经被初始化'
|
||||
},
|
||||
login: {
|
||||
username: '登录名',
|
||||
pin: '密码',
|
||||
login: '登录',
|
||||
verify: '验证',
|
||||
verifyDialogTitle: '双因子认证设置',
|
||||
verifyTitle: '双因子认证',
|
||||
verifyContent: '在您的移动设备上输入来自双因子应用程序的代码。 如果您丢失了设备,您可以输入您的恢复代码之一。',
|
||||
verifyPlaceholder: '验证码',
|
||||
bindFail: '绑定失败'
|
||||
},
|
||||
...zhLocale
|
||||
}
|
||||
export default newcn
|
||||
79
nezha-fronted/src/components/common/language/newen.js
Normal file
79
nezha-fronted/src/components/common/language/newen.js
Normal file
@@ -0,0 +1,79 @@
|
||||
import enLocale from 'element-ui/lib/locale/lang/en' // 引入element语言包
|
||||
const newen = {
|
||||
// 命名原则
|
||||
// 创建使用New
|
||||
// 表示创建状态用Created,如创建时间Created Time
|
||||
// 告警使用Alert,而不是Alarm
|
||||
// 账号用Account,username、password等都属于account的一部分
|
||||
// A user is the person who uses the account, the account is an inanimate object that is merely registered to an e-mail address.
|
||||
setup: {
|
||||
step0: 'Welcome',
|
||||
step1: 'Database',
|
||||
step2: 'Redis',
|
||||
step3: 'System',
|
||||
host: 'Host',
|
||||
port: 'Port',
|
||||
language: 'Language',
|
||||
welcome: {
|
||||
header: 'Welcome to Nezha setup wizard!',
|
||||
guid: 'What will the wizard do for you?',
|
||||
guid_1: 'Create a basic configuration',
|
||||
guid_2: 'Tries to find problems within your Database and Redis setup',
|
||||
toContinue: 'To continue',
|
||||
creatFile: 'For security reasons you need to authenticate for the installation by creating the file',
|
||||
createFileTip: 'This can be done by executing the following command',
|
||||
next: "Click the 'Next' button when you've finished."
|
||||
},
|
||||
database: {
|
||||
configTitle: 'Configure DB connection',
|
||||
configTip: "Please create database manually,and set the configuration parameters for connection to this database,Press 'Next' button when done"
|
||||
},
|
||||
redis: {
|
||||
configTitle: 'Configure Redis connection',
|
||||
configTip: "Please set the configuration parameters for connection to this redis,Press 'Next' button when done"
|
||||
},
|
||||
system: {
|
||||
configTitle: 'System configuration',
|
||||
configTip: 'Please enter username and password for administrator ,and set the Nezha WEB module install information,like IP:port',
|
||||
federation: 'Federation',
|
||||
federationEnable: 'Enable',
|
||||
federationDisable: 'Disable'
|
||||
|
||||
},
|
||||
name: 'Database name',
|
||||
username: 'Username',
|
||||
pin: 'Password',
|
||||
alertPath: 'Site URL',
|
||||
alertPrefix: 'Alert prefix',
|
||||
haMode: 'HA mode',
|
||||
haVip: 'Virtual IP',
|
||||
next: 'Next',
|
||||
back: 'Back',
|
||||
finish: 'Finish',
|
||||
invalidDb: 'There may be some errors in the configuration of the database',
|
||||
invalidRedis: 'There may be some errors in the configuration of the Redis',
|
||||
invalidPin: "Redis's password may be wrong",
|
||||
requirePin: 'The password may be required by the Redis',
|
||||
wait: 'The configuration has been saved, please wait patiently for it to take effect',
|
||||
reloadTimeout: 'It took too much time to restart the server, there may be some problems when you install',
|
||||
hadConfig: 'Someone has started to configure the system',
|
||||
invalidCode: "The authentication is invalid ,please follow the description in {page} 'To continue'",
|
||||
welcomePage: 'Welcome page',
|
||||
inited: 'The system has been initialized'
|
||||
},
|
||||
login: {
|
||||
username: 'Username',
|
||||
pin: 'Password',
|
||||
login: 'Login',
|
||||
upload: 'Upload license',
|
||||
verify: 'Verify code',
|
||||
verifyDialogTitle: 'Two Factor Authentication Set Up',
|
||||
verifyTitle: 'Two-Factor Authentication',
|
||||
verifyContent: 'Enter the code from the two -factor app on your mobile device. If you\' ve lost your device, you may enter one of your recovery codes.',
|
||||
verifyPlaceholder: 'verify code',
|
||||
bindFail: 'Binding failure'
|
||||
},
|
||||
...enLocale
|
||||
}
|
||||
|
||||
export default newen
|
||||
Reference in New Issue
Block a user