refactor(i18n): Optimise `i18n` field structure.

This commit is contained in:
haitaoo 2023-07-11 15:15:01 +08:00
parent f7ba449fe1
commit 23764ab543
3 changed files with 27 additions and 29 deletions

View File

@ -1410,6 +1410,31 @@ ui:
title: Change user role to...
btn_cancel: Cancel
btn_submit: Submit
new_password_modal:
title: Set new password
form:
fields:
password:
label: Password
text: The user will be logged out and need to login again.
msg: Password must be at 8-32 characters in length.
btn_cancel: Cancel
btn_submit: Submit
user_modal:
title: Add new user
form:
fields:
display_name:
label: Display Name
msg: Display Name must be at 3-30 characters in length.
email:
label: Email
msg: Email is not valid.
password:
label: Password
msg: Password must be at 8-32 characters in length.
btn_cancel: Cancel
btn_submit: Submit
users:
title: Users
name: Name
@ -1438,33 +1463,6 @@ ui:
change_role: Change role
show_logs: Show logs
add_user: Add user
new_password_modal:
title: Set new password
form:
fields:
password:
label: Password
text: The user will be logged out and need to login again.
msg: Password must be at 8-32 characters in length.
btn_cancel: Cancel
btn_submit: Submit
user_modal:
title: Add new user
form:
fields:
display_name:
label: Display Name
msg: Display Name must be at 3-30 characters in length.
email:
label: Email
msg: Email is not valid.
password:
label: Password
msg: Password must be at 8-32 characters in length.
btn_cancel: Cancel
btn_submit: Submit
questions:
page_title: Questions
normal: Normal

View File

@ -17,7 +17,7 @@ interface IProps {
}
const useChangePasswordModal = (props: IProps = {}) => {
const { t } = useTranslation('translation', {
keyPrefix: 'admin.users.new_password_modal',
keyPrefix: 'admin.new_password_modal',
});
const { title = t('title'), onConfirm } = props;

View File

@ -18,7 +18,7 @@ interface IProps {
}
const useAddUserModal = (props: IProps = {}) => {
const { t } = useTranslation('translation', {
keyPrefix: 'admin.users.user_modal',
keyPrefix: 'admin.user_modal',
});
const { title = t('title'), onConfirm } = props;