Fix broken error messages

This commit is contained in:
Yang Luo
2024-02-27 22:48:33 +08:00
parent b0d87f60ae
commit 4d9c81ef96
5 changed files with 5 additions and 5 deletions

View File

@ -91,7 +91,7 @@ class PermissionListPage extends BaseListPage {
const {pagination} = this.state; const {pagination} = this.state;
this.fetch({pagination}); this.fetch({pagination});
} else { } else {
Setting.showMessage("error", `Users failed to upload: ${res.msg}`); Setting.showMessage("error", `${i18next.t("general:Failed to sync")}: ${res.msg}`);
} }
} else if (status === "error") { } else if (status === "error") {
Setting.showMessage("error", "File failed to upload"); Setting.showMessage("error", "File failed to upload");

View File

@ -83,7 +83,7 @@ class RoleListPage extends BaseListPage {
const {pagination} = this.state; const {pagination} = this.state;
this.fetch({pagination}); this.fetch({pagination});
} else { } else {
Setting.showMessage("error", `Users failed to upload: ${res.msg}`); Setting.showMessage("error", `${i18next.t("general:Failed to sync")}: ${res.msg}`);
} }
} else if (status === "error") { } else if (status === "error") {
Setting.showMessage("error", "File failed to upload"); Setting.showMessage("error", "File failed to upload");

View File

@ -454,7 +454,7 @@ class SyncerEditPage extends React.Component {
Setting.showMessage("success", i18next.t("syncer:Connect successfully")); Setting.showMessage("success", i18next.t("syncer:Connect successfully"));
} else { } else {
this.setState({testDbLoading: false}); this.setState({testDbLoading: false});
Setting.showMessage("error", i18next.t("syncer:Failed to connect") + ": " + res.msg); Setting.showMessage("error", `${i18next.t("syncer:Failed to connect")}: ${res.msg}`);
} }
}) })
.catch(error => { .catch(error => {

View File

@ -223,7 +223,7 @@ class SignupPage extends React.Component {
Setting.goToLinkSoft(this, this.getResultPath(application, values)); Setting.goToLinkSoft(this, this.getResultPath(application, values));
} }
} else { } else {
Setting.showMessage("error", i18next.t(`signup:${res.msg}`)); Setting.showMessage("error", res.msg);
} }
}); });
} }

View File

@ -147,7 +147,7 @@ export function sendCode(captchaType, captchaToken, clientSecret, method, countr
Setting.showMessage("success", i18next.t("user:Verification code sent")); Setting.showMessage("success", i18next.t("user:Verification code sent"));
return true; return true;
} else { } else {
Setting.showMessage("error", i18next.t("user:" + res.msg)); Setting.showMessage("error", res.msg);
return false; return false;
} }
}); });