Skip to content

Commit c98a8e0

Browse files
authored
Merge pull request #13 from GitDataAI/fix/auth-language
fix(auth-language): Update signin and signup page to improve Chinese …
2 parents e9474d9 + 221843a commit c98a8e0

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

src/app/(auth)/sigin/page.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ export default function Sigin() {
2121
validate: {
2222
username: (value) => {
2323
if (value.length < 4) {
24-
return '用户名至少四位';
24+
return 'UserName last has 4 len';
2525
}
2626
return null;
2727
},
2828
password: (value) => {
2929
if (value.length < 6) {
3030

31-
return '密码至少六位';
31+
return 'Password last has 6 len';
3232
}
3333
return null;
3434
},
3535
captcha: (value) => {
3636
if (value.length !== 4) {
37-
return '验证码为4位';
37+
return 'Captcha is 4 len';
3838
}
3939
},
4040
},
@@ -75,7 +75,7 @@ export default function Sigin() {
7575
if (res.status !== 200) {
7676
notifications.show({
7777
title: 'Failed',
78-
message: '登陆失败',
78+
message: 'Login Err',
7979
color: 'red',
8080
});
8181
return;
@@ -86,8 +86,8 @@ export default function Sigin() {
8686
} = await res.json();
8787
if (json.code === 0) {
8888
notifications.show({
89-
title: '登陆成功',
90-
message: '正在跳转',
89+
title: 'Login Success',
90+
message: 'wait',
9191
color: 'green',
9292
});
9393
user.setUser((json as {
@@ -115,12 +115,12 @@ export default function Sigin() {
115115
<h1>登陆</h1>
116116
<Form form={form} className="form">
117117
<div>
118-
<TextInput label="账号" placeholder="请输入你的用户名或邮箱"
118+
<TextInput label="Account" placeholder="Please input you username or email"
119119
key={form.key('username')} {...form.getInputProps('username')}/>
120-
<PasswordInput label="密码" placeholder="请输入你的密码"
120+
<PasswordInput label="Password" placeholder="Please input you password"
121121
key={form.key('password')} {...form.getInputProps('password')}/>
122122
<div className="email-captcha">
123-
<TextInput placeholder="请输入图片验证码" name="captcha"
123+
<TextInput placeholder="Please input Captcha for right image" name="captcha"
124124
key={form.key('captcha')} {...form.getInputProps('captcha')} />
125125
{
126126
Captcha ? (
@@ -135,18 +135,18 @@ export default function Sigin() {
135135
const validate = form.validate();
136136
if (validate.hasErrors) {
137137
notifications.show({
138-
title: '登陆失败',
139-
message: "用户名或密码格式错误",
138+
title: 'Login Error',
139+
message: "Please check username or password error",
140140
color: 'red',
141141
});
142142
return;
143143
}
144144
Submit();
145-
}}>登陆</Button>
146-
<Divider label="还没有账号?"/>
145+
}}>Login</Button>
146+
<Divider label="Not Account?"/>
147147
<Button type="button" color="dark" onClick={() => {
148148
nav('/sigup')
149-
}}>注册</Button>
149+
}}>Sign up</Button>
150150
</Form>
151151
</>
152152

src/app/(auth)/sigup/page.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,42 @@ export default function SigUp() {
2727
validate: {
2828
username: (value) => {
2929
if (step === 0) {
30-
return (value.length < 6 ? '用户名至少六位' : null);
30+
return (value.length < 6 ? 'username last 6 len' : null);
3131
}
3232
return null;
3333
},
3434
password0: (value) => {
3535
if (step === 2) {
36-
return (value.length < 6 ? '密码至少六位' : null);
36+
return (value.length < 6 ? 'password last 6 len' : null);
3737
}
3838
return null;
3939
},
4040
password1: (value) => {
4141
if (step === 2) {
42-
return (value.length < 6 ? '密码至少六位' : null);
42+
return (value.length < 6 ? 'password last 6 len' : null);
4343
}
4444
return null;
4545
},
4646
captcha: (value) => {
4747
if (step === 2) {
48-
return (value.length < 4 ? '验证码至少四位' : null);
48+
return (value.length < 4 ? 'image captcha last 4 len' : null);
4949
}
5050
return null;
5151
},
5252
email: (value) => {
5353
if (step === 0) {
5454
if (!value.includes('@')) {
55-
return '邮箱格式错误';
55+
return 'Email format err';
5656
}
5757
if (!value.includes('.')) {
58-
return '邮箱格式错误';
58+
return 'Email format err';
5959
}
6060
}
6161
return null;
6262
},
6363
code: (value) => {
6464
if (step === 1) {
65-
return (value.length < 6 ? '验证码至少六位' : null);
65+
return (value.length < 6 ? 'Email Captcha code last eq 6 len' : null);
6666
}
6767
return null;
6868
},
@@ -129,7 +129,7 @@ export default function SigUp() {
129129
if (data.code === 0) {
130130
notifications.show({
131131
title: 'Success',
132-
message: '验证码发送成功',
132+
message: 'Email captcha send successful',
133133
color: 'green',
134134
});
135135
setStep(1);
@@ -144,7 +144,7 @@ export default function SigUp() {
144144
} else {
145145
notifications.show({
146146
title: 'Failed',
147-
message: '验证码发送失败',
147+
message: 'email captcha send error',
148148
color: 'red',
149149
});
150150
}
@@ -160,7 +160,7 @@ export default function SigUp() {
160160
} else {
161161
notifications.show({
162162
title: 'Failed',
163-
message: '验证码发送失败',
163+
message: 'email captcha send error',
164164
color: 'red',
165165
});
166166
}
@@ -174,7 +174,7 @@ export default function SigUp() {
174174
if (code.length !== 6) {
175175
notifications.show({
176176
title: 'Failed',
177-
message: '验证码错误',
177+
message: 'Email captcha code err',
178178
color: 'red',
179179
});
180180
return;
@@ -199,7 +199,7 @@ export default function SigUp() {
199199
if (data.code === 0) {
200200
notifications.show({
201201
title: 'Success',
202-
message: '验证码正确',
202+
message: 'Captcha Successful',
203203
color: 'green',
204204
});
205205
setStep(2);
@@ -214,7 +214,7 @@ export default function SigUp() {
214214
} else {
215215
notifications.show({
216216
title: 'Failed',
217-
message: '验证码错误',
217+
message: 'Captcha Err',
218218
color: 'red',
219219
});
220220
}
@@ -228,7 +228,7 @@ export default function SigUp() {
228228
if (data.password0 !== data.password1) {
229229
notifications.show({
230230
title: 'Failed',
231-
message: '两次密码不一致',
231+
message: 'password not is same',
232232
color: 'red',
233233
});
234234
return;
@@ -255,7 +255,7 @@ export default function SigUp() {
255255
if (data.code === 0) {
256256
notifications.show({
257257
title: 'Success',
258-
message: '注册成功',
258+
message: 'Sign up successful',
259259
color: 'green',
260260
});
261261
} else {
@@ -269,7 +269,7 @@ export default function SigUp() {
269269
} else {
270270
notifications.show({
271271
title: 'Failed',
272-
message: '注册失败',
272+
message: 'Sign up error',
273273
color: 'red',
274274
});
275275
}
@@ -281,7 +281,7 @@ export default function SigUp() {
281281
}, []);
282282
return (
283283
<>
284-
<h1>注册</h1>
284+
<h1>Sign up</h1>
285285
<Form form={form} className="form">
286286
{
287287
(step === 0) ? <Sign0 form={form}/> : null
@@ -296,14 +296,14 @@ export default function SigUp() {
296296
Next();
297297
}}>
298298
{
299-
(step <= 1) ? '下一步' : '完成'
299+
(step <= 1) ? 'next' : 'submit'
300300
}
301301
</Button>
302-
<Divider label="已经有账号了?去登陆"/>
302+
<Divider label="aleary has account?go sign in"/>
303303
<Button type="button" color="dark" onClick={() => {
304304
nav('/sigin')
305305
}}>
306-
登陆
306+
Sign in
307307
</Button>
308308
</Form>
309309
</>

0 commit comments

Comments
 (0)