Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
13aa61bb
Commit
13aa61bb
authored
Sep 17, 2022
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update i18n for change password dialog
parent
f4d0e8c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
10 deletions
+22
-10
ChangePasswordDialog.tsx
web/src/components/ChangePasswordDialog.tsx
+4
-4
MyAccountSection.tsx
web/src/components/Settings/MyAccountSection.tsx
+6
-0
en.json
web/src/locales/en.json
+4
-2
vi.json
web/src/locales/vi.json
+4
-2
zh.json
web/src/locales/zh.json
+4
-2
No files found.
web/src/components/ChangePasswordDialog.tsx
View file @
13aa61bb
...
...
@@ -17,7 +17,7 @@ const validateConfig: ValidatorConfig = {
type
Props
=
DialogProps
;
const
ChangePasswordDialog
:
React
.
FC
<
Props
>
=
({
destroy
}:
Props
)
=>
{
const
{
t
,
locale
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
[
newPassword
,
setNewPassword
]
=
useState
(
""
);
const
[
newPasswordAgain
,
setNewPasswordAgain
]
=
useState
(
""
);
...
...
@@ -53,7 +53,7 @@ const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
const
passwordValidResult
=
validate
(
newPassword
,
validateConfig
);
if
(
!
passwordValidResult
.
result
)
{
toastHelper
.
error
(
t
(
"common.password"
)
+
locale
===
"zh"
?
""
:
" "
+
passwordValidResult
.
reason
);
toastHelper
.
error
(
`
${
t
(
"common.password"
)}
${
passwordValidResult
.
reason
}
`
);
return
;
}
...
...
@@ -63,7 +63,7 @@ const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
id
:
user
.
id
,
password
:
newPassword
,
});
toastHelper
.
info
(
t
(
"
common.password"
)
+
t
(
"common.
changed"
));
toastHelper
.
info
(
t
(
"
message.password-
changed"
));
handleCloseBtnClick
();
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
...
...
@@ -74,7 +74,7 @@ const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
return
(
<>
<
div
className=
"dialog-header-container"
>
<
p
className=
"title-text"
>
{
t
(
"
common.password"
+
" "
+
t
(
"common.change"
)
)
}
</
p
>
<
p
className=
"title-text"
>
{
t
(
"
setting.account-section.change-password"
)
}
</
p
>
<
button
className=
"btn close-btn"
onClick=
{
handleCloseBtnClick
}
>
<
Icon
.
X
/>
</
button
>
...
...
web/src/components/Settings/MyAccountSection.tsx
View file @
13aa61bb
...
...
@@ -58,6 +58,12 @@ const MyAccountSection = () => {
title
:
"Reset Open API"
,
content
:
"❗️The existing API will be invalidated and a new one will be generated, are you sure you want to reset?"
,
style
:
"warning"
,
onConfirm
:
async
()
=>
{
await
userService
.
patchUser
({
id
:
user
.
id
,
resetOpenId
:
true
,
});
},
});
};
...
...
web/src/locales/en.json
View file @
13aa61bb
...
...
@@ -99,7 +99,8 @@
"member"
:
"Member"
,
"member-list"
:
"Member list"
,
"account-section"
:
{
"title"
:
"Account Information"
"title"
:
"Account Information"
,
"change-password"
:
"Change password"
},
"preference-section"
:
{
"default-memo-visibility"
:
"Default memo visibility"
,
...
...
@@ -128,6 +129,7 @@
"fill-form"
:
"Please fill out this form"
,
"login-failed"
:
"Login failed"
,
"signup-failed"
:
"Signup failed"
,
"user-not-found"
:
"User not found"
"user-not-found"
:
"User not found"
,
"password-changed"
:
"Password Changed"
}
}
web/src/locales/vi.json
View file @
13aa61bb
...
...
@@ -99,7 +99,8 @@
"member"
:
"Thành viên"
,
"member-list"
:
"Danh sách thành viên"
,
"account-section"
:
{
"title"
:
"Thông tin tài khoản"
"title"
:
"Thông tin tài khoản"
,
"change-password"
:
"đổi mật khẩu"
},
"preference-section"
:
{
"default-memo-visibility"
:
"Chế độ memo mặc định"
,
...
...
@@ -128,6 +129,7 @@
"fill-form"
:
"Please fill out this form"
,
"login-failed"
:
"Đăng nhập thất bại"
,
"signup-failed"
:
"Đăng ký thất bại"
,
"user-not-found"
:
"Không tìm thấy người dùng này"
"user-not-found"
:
"Không tìm thấy người dùng này"
,
"password-changed"
:
"mật khẩu đã được thay đổi"
}
}
web/src/locales/zh.json
View file @
13aa61bb
...
...
@@ -99,7 +99,8 @@
"member"
:
"成员"
,
"member-list"
:
"成员列表"
,
"account-section"
:
{
"title"
:
"账号信息"
"title"
:
"账号信息"
,
"change-password"
:
"修改密码"
},
"preference-section"
:
{
"default-memo-visibility"
:
"默认 Memo 可见性"
,
...
...
@@ -128,6 +129,7 @@
"fill-form"
:
"请填写此表单"
,
"login-failed"
:
"登录失败"
,
"signup-failed"
:
"注册失败"
,
"user-not-found"
:
"未找到用户"
"user-not-found"
:
"未找到用户"
,
"password-changed"
:
"密码已修改"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment