mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
translation and little format fixture
This commit is contained in:
1 parent
f6c3b33da9
commit
9da23b5dc1
14 files changed
+155
-54
No files matched your search
@@ -8,21 +8,24 @@ import { checkUsername, chooseUsername } from '../utils/auth'
|
||||
async function check({ username, error }) {
|
||||
if (username) {
|
||||
if (!isValidUsername(username)) {
|
||||
error('Invalid username.')
|
||||
// error('Invalid username.')
|
||||
error('無效的帳號名稱')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await checkUsername(username)
|
||||
} catch (err) {
|
||||
if (err instanceof TooManyRequestsError) {
|
||||
error('Too many requests. Try again in 2 minutes.')
|
||||
// error('Too many requests. Try again in 2 minutes.')
|
||||
error('太多請求,兩分鐘後再試一次。')
|
||||
return
|
||||
}
|
||||
if (err instanceof ValidationError) {
|
||||
error(err.message)
|
||||
return
|
||||
}
|
||||
error('Something went wrong. Please try again later.')
|
||||
// error('Something went wrong. Please try again later.')
|
||||
error('出了點問題,請再試一次。')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +36,8 @@ async function handleSubmit({ username, success, error }) {
|
||||
success()
|
||||
} catch (err) {
|
||||
if (err instanceof TooManyRequestsError) {
|
||||
error('Too many requests. Try again in 2 minutes.')
|
||||
// error('Too many requests. Try again in 2 minutes.')
|
||||
error('太多請求,兩分鐘後再試一次。')
|
||||
return
|
||||
}
|
||||
if (err instanceof ValidationError) {
|
||||
|
||||
Reference in new issue
Block a user