Skip to content

Commit 659ee09

Browse files
committed
more localization for chinese texts
1 parent 113f456 commit 659ee09

File tree

1 file changed

+46
-47
lines changed

1 file changed

+46
-47
lines changed

Vue/src/views/own-space/own-space.vue

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Card>
88
<p slot="title">
99
<Icon type="person"></Icon>
10-
个人信息
10+
{{'Personal Information'|l}}
1111
</p>
1212
<div>
1313
<Form
@@ -39,58 +39,59 @@
3939
</div>
4040
</div>
4141
</FormItem>
42-
<FormItem label="公司:">
42+
<FormItem label="{{'Company'|l}}:">
4343
<span>{{ userForm.company }}</span>
4444
</FormItem>
45-
<FormItem label="部门:">
45+
<FormItem label="{{'Department'|l}}:">
4646
<span>{{ userForm.department }}</span>
4747
</FormItem>
48-
<FormItem label="登录密码:">
49-
<Button type="text" size="small" @click="showEditPassword">修改密码</Button>
48+
<FormItem label="{{'Password'|l}}:">
49+
<Button type="text" size="small" @click="showEditPassword">{{'Change Password'|l}}</Button>
5050
</FormItem>
5151
<div>
52-
<Button type="text" style="width: 100px;" @click="cancelEditUserInfor">取消</Button>
53-
<Button type="primary" style="width: 100px;" :loading="save_loading" @click="saveEdit">保存</Button>
52+
<Button type="text" style="width: 100px;" @click="cancelEditUserInfor">{{'Cancel'|l}}</Button>
53+
<Button type="primary" style="width: 100px;" :loading="save_loading" @click="saveEdit">{{'Save'|l}}</Button>
5454
</div>
5555
</Form>
5656
</div>
5757
</Card>
5858
<Modal v-model="editPasswordModal" :closable='false' :mask-closable=false :width="500">
59-
<h3 slot="header" style="color:#2D8CF0">修改密码</h3>
59+
<h3 slot="header" style="color:#2D8CF0">{{'Change Password'|l}}</h3>
6060
<Form ref="editPasswordForm" :model="editPasswordForm" :label-width="100" label-position="right" :rules="passwordValidate">
61-
<FormItem label="原密码" prop="oldPass" :error="oldPassError">
62-
<Input v-model="editPasswordForm.oldPass" placeholder="请输入现在使用的密码" ></Input>
61+
<FormItem label="OldPassword" prop="oldPass" :error="oldPassError">
62+
<Input v-model="editPasswordForm.oldPass" placeholder="{{'Please enter the password you are using now'|l}}" ></Input>
6363
</FormItem>
64-
<FormItem label="新密码" prop="newPass">
65-
<Input v-model="editPasswordForm.newPass" placeholder="请输入新密码,至少6位字符" ></Input>
64+
<FormItem label="NewPassword" prop="newPass">
65+
<Input v-model="editPasswordForm.newPass" placeholder="{{'Please enter a new password, at least 6 characters'|l}}" ></Input>
6666
</FormItem>
67-
<FormItem label="确认新密码" prop="rePass">
68-
<Input v-model="editPasswordForm.rePass" placeholder="请再次输入新密码" ></Input>
67+
<FormItem label="ConfirmNewPassword" prop="rePass">
68+
<Input v-model="editPasswordForm.rePass" placeholder="{{'Please re-enter the new password'|l}}" ></Input>
6969
</FormItem>
7070
</Form>
7171
<div slot="footer">
72-
<Button type="text" @click="cancelEditPass">取消</Button>
73-
<Button type="primary" :loading="savePassLoading" @click="saveEditPass">保存</Button>
72+
<Button type="text" @click="cancelEditPass">{{'Cancel'|l}}</Button>
73+
<Button type="primary" :loading="savePassLoading" @click="saveEditPass">{{'Save'|l}}</Button>
7474
</div>
7575
</Modal>
7676
</div>
7777
</template>
7878

7979
<script>
80+
import util from '@/libs/util.js';
8081
export default {
8182
name: 'ownspace_index',
8283
data () {
8384
const validePhone = (rule, value, callback) => {
8485
var re = /^1[0-9]{10}$/;
8586
if (!re.test(value)) {
86-
callback(new Error('请输入正确格式的手机号'));
87+
callback(new Error(util.l('Please enter the phone number in the correct format')));
8788
} else {
8889
callback();
8990
}
9091
};
9192
const valideRePassword = (rule, value, callback) => {
9293
if (value !== this.editPasswordForm.newPass) {
93-
callback(new Error('两次输入密码不一致'));
94+
callback(new Error(util.l('New password does not match with old password')));
9495
} else {
9596
callback();
9697
}
@@ -102,24 +103,24 @@ export default {
102103
company: '',
103104
department: ''
104105
},
105-
uid: '', // 登录用户的userId
106-
securityCode: '', // 验证码
107-
phoneHasChanged: false, // 是否编辑了手机
106+
uid: '',
107+
securityCode: '',
108+
phoneHasChanged: false,
108109
save_loading: false,
109-
identifyError: '', // 验证码错误
110-
editPasswordModal: false, // 修改密码模态框显示
110+
identifyError: '',
111+
editPasswordModal: false,
111112
savePassLoading: false,
112113
oldPassError: '',
113-
identifyCodeRight: false, // 验证码是否正确
114-
hasGetIdentifyCode: false, // 是否点了获取验证码
115-
canGetIdentifyCode: false, // 是否可点获取验证码
114+
identifyCodeRight: false,
115+
hasGetIdentifyCode: false,
116+
canGetIdentifyCode: false,
116117
checkIdentifyCodeLoading: false,
117118
inforValidate: {
118119
name: [
119-
{ required: true, message: '请输入姓名', trigger: 'blur' }
120+
{ required: true, message: util.l('Please type in your name'), trigger: 'blur' }
120121
],
121122
cellphone: [
122-
{ required: true, message: '请输入手机号码' },
123+
{ required: true, message: util.l('Please enter the phone number') },
123124
{ validator: validePhone }
124125
]
125126
},
@@ -130,21 +131,21 @@ export default {
130131
},
131132
passwordValidate: {
132133
oldPass: [
133-
{ required: true, message: '请输入原密码', trigger: 'blur' }
134+
{ required: true, message: util.l('Please enter the original password'), trigger: 'blur' }
134135
],
135136
newPass: [
136-
{ required: true, message: '请输入新密码', trigger: 'blur' },
137-
{ min: 6, message: '请至少输入6个字符', trigger: 'blur' },
138-
{ max: 32, message: '最多输入32个字符', trigger: 'blur' }
137+
{ required: true, message: util.l('Please enter the new psasword'), trigger: 'blur' },
138+
{ min: 6, message: util.l('Please enter at least 6 characters'), trigger: 'blur' },
139+
{ max: 32, message: util.l('Please enter maximum 32 characters'), trigger: 'blur' }
139140
],
140141
rePass: [
141-
{ required: true, message: '请再次输入新密码', trigger: 'blur' },
142+
{ required: true, message: util.l('Please re-enter the new password'), trigger: 'blur' },
142143
{ validator: valideRePassword, trigger: 'blur' }
143144
]
144145
},
145-
inputCodeVisible: false, // 显示填写验证码box
146+
inputCodeVisible: false,
146147
initPhone: '',
147-
gettingIdentifyCodeBtnContent: '获取验证码' // “获取验证码”按钮的文字
148+
gettingIdentifyCodeBtnContent: util.l('Get verification code')
148149
};
149150
},
150151
methods: {
@@ -165,7 +166,6 @@ export default {
165166
}
166167
}, 1000);
167168
this.inputCodeVisible = true;
168-
// you can write ajax request here
169169
}
170170
});
171171
},
@@ -188,15 +188,15 @@ export default {
188188
saveEdit () {
189189
this.$refs['userForm'].validate((valid) => {
190190
if (valid) {
191-
if (this.phoneHasChanged && this.userForm.cellphone !== this.initPhone) { // 手机号码修改过了而且修改之后的手机号和原来的不一样
192-
if (this.hasGetIdentifyCode) { // 判断是否点了获取验证码
193-
if (this.identifyCodeRight) { // 判断验证码是否正确
191+
if (this.phoneHasChanged && this.userForm.cellphone !== this.initPhone) {
192+
if (this.hasGetIdentifyCode) {
193+
if (this.identifyCodeRight) {
194194
this.saveInfoAjax();
195195
} else {
196-
this.$Message.error('验证码错误,请重新输入');
196+
this.$Message.error(util.l('Verification code error, please re-enter'));
197197
}
198198
} else {
199-
this.$Message.warning('请先点击获取验证码');
199+
this.$Message.warning(util.l('Please click to get the verification code'));
200200
}
201201
} else {
202202
this.saveInfoAjax();
@@ -211,16 +211,15 @@ export default {
211211
this.$refs['editPasswordForm'].validate((valid) => {
212212
if (valid) {
213213
this.savePassLoading = true;
214-
// you can write ajax request here
215214
}
216215
});
217216
},
218217
init () {
219218
this.userForm.name = 'Lison';
220219
this.userForm.cellphone = '17712345678';
221220
this.initPhone = '17712345678';
222-
this.userForm.company = 'TalkingData';
223-
this.userForm.department = '可视化部门';
221+
this.userForm.company = 'AbpProjectName';
222+
this.userForm.department = 'IT';
224223
},
225224
cancelInputCodeBox () {
226225
this.inputCodeVisible = false;
@@ -230,10 +229,10 @@ export default {
230229
let vm = this;
231230
vm.checkIdentifyCodeLoading = true;
232231
if (this.securityCode.length === 0) {
233-
this.$Message.error('请填写短信验证码');
232+
this.$Message.error(util.l('Please fill in SMS verification code'));
234233
} else {
235234
setTimeout(() => {
236-
this.$Message.success('验证码正确');
235+
this.$Message.success(util.l('The verification code is correct'));
237236
this.inputCodeVisible = false;
238237
this.checkIdentifyCodeLoading = false;
239238
}, 1000);
@@ -247,7 +246,7 @@ export default {
247246
saveInfoAjax () {
248247
this.save_loading = true;
249248
setTimeout(() => {
250-
this.$Message.success('保存成功');
249+
this.$Message.success(util.l('SavedSuccessfully'));
251250
this.save_loading = false;
252251
}, 1000);
253252
}

0 commit comments

Comments
 (0)