diff --git a/controllers/util.go b/controllers/util.go index 981a03f1..ffc6710d 100644 --- a/controllers/util.go +++ b/controllers/util.go @@ -84,7 +84,7 @@ func (c *ApiController) SetTokenErrorHttpStatus() { func (c *ApiController) RequireSignedIn() (string, bool) { userId := c.GetSessionUsername() if userId == "" { - c.ResponseError(c.T("util:Please login first"), "util:Please login first") + c.ResponseError(c.T("util:Please login first"), "Please login first") return "", false } return userId, true diff --git a/web/src/App.js b/web/src/App.js index 27a13f26..ff0c5979 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -224,7 +224,7 @@ class App extends Component { this.setLanguage(account); } else { if (res.data !== "Please login first") { - Setting.showMessage("error", `Failed to sign in: ${res.msg}`); + Setting.showMessage("error", `${i18next.t("application:Failed to sign in")}: ${res.msg}`); } } @@ -249,7 +249,7 @@ class App extends Component { account: null, }); - Setting.showMessage("success", "Logged out successfully"); + Setting.showMessage("success", i18next.t("application:Logged out successfully")); const redirectUri = res.data2; if (redirectUri !== null && redirectUri !== undefined && redirectUri !== "") { Setting.goToLink(redirectUri); diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index b1f5c141..91b9dad1 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -293,7 +293,7 @@ class LoginPage extends React.Component { const responseType = values["type"]; if (responseType === "login") { - Setting.showMessage("success", "Logged in successfully"); + Setting.showMessage("success", i18next.t("application:Logged in successfully")); const link = Setting.getFromLink(); Setting.goToLink(link); diff --git a/web/src/common/PoliciyTable.js b/web/src/common/PoliciyTable.js index 6cdd8570..46340fc8 100644 --- a/web/src/common/PoliciyTable.js +++ b/web/src/common/PoliciyTable.js @@ -92,6 +92,7 @@ class PolicyTable extends React.Component { .then((res) => { if (res.status === "ok") { this.setState({policyLists: res.data}); + Setting.showMessage("success", i18next.t("adapter:Sync policies successfully")); } else { Setting.showMessage("error", `${i18next.t("adapter:Failed to sync policies")}: ${res.msg}`); } @@ -293,7 +294,7 @@ class PolicyTable extends React.Component { render() { return (<> - { diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 842d4193..8f1cb44e 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Aktiviere Anmeldesession - Tooltip", "Enable signup": "Anmeldung aktivieren", "Enable signup - Tooltip": "Whether to allow users to sign up", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "Datei erfolgreich hochgeladen", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Grant types", "Grant types - Tooltip": "Grant types - Tooltip", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "New Application", "None": "None", "Password ON": "Passwort AN", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index b43a4ecc..ed59511d 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Enable signin session - Tooltip", "Enable signup": "Enable signup", "Enable signup - Tooltip": "Enable signup - Tooltip", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "File uploaded successfully", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Grant types", "Grant types - Tooltip": "Grant types - Tooltip", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "New Application", "None": "None", "Password ON": "Password ON", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index c38275cd..1e7c94f8 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Activer la session de connexion - infobulle", "Enable signup": "Activer l'inscription", "Enable signup - Tooltip": "Whether to allow users to sign up", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "Fichier téléchargé avec succès", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Grant types", "Grant types - Tooltip": "Grant types - Tooltip", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "New Application", "None": "None", "Password ON": "Mot de passe activé", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index 9d48f009..d00f505b 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Enable signin session - Tooltip", "Enable signup": "サインアップを有効にする", "Enable signup - Tooltip": "Whether to allow users to sign up", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "ファイルが正常にアップロードされました", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Grant types", "Grant types - Tooltip": "Grant types - Tooltip", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "New Application", "None": "None", "Password ON": "パスワードON", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index 540a80f1..c66dea2c 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Enable signin session - Tooltip", "Enable signup": "Enable signup", "Enable signup - Tooltip": "Whether to allow users to sign up", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "File uploaded successfully", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Grant types", "Grant types - Tooltip": "Grant types - Tooltip", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "New Application", "None": "None", "Password ON": "Password ON", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index fbb08747..78b07035 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "Edit Adapter", - "Failed to sync policies: ": "Failed to sync policies: ", + "Failed to sync policies": "Failed to sync policies", "New Adapter": "New Adapter", "Policies": "Policies", "Policies - Tooltip": "Policies - Tooltip", "Repeated policy rules": "Repeated policy rules", - "Sync": "Sync" + "Sync": "Sync", + "Sync policies successfully": "Sync policies successfully" }, "application": { "Always": "Always", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "Включить сеанс входа - Подсказка", "Enable signup": "Включить регистрацию", "Enable signup - Tooltip": "Whether to allow users to sign up", + "Failed to sign in": "Failed to sign in", "File uploaded successfully": "Файл успешно загружен", "Form CSS": "Form CSS", "Form CSS - Edit": "Form CSS - Edit", @@ -45,6 +47,8 @@ "Grant types": "Виды грантов", "Grant types - Tooltip": "Виды грантов - Подсказка", "Left": "Left", + "Logged in successfully": "Logged in successfully", + "Logged out successfully": "Logged out successfully", "New Application": "Новое приложение", "None": "None", "Password ON": "Пароль ВКЛ", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 52a39188..78c4469b 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -7,12 +7,13 @@ }, "adapter": { "Edit Adapter": "编辑适配器", - "Failed to sync policies: ": "同步策略失败: ", + "Failed to sync policies": "同步策略失败", "New Adapter": "添加适配器", "Policies": "策略", "Policies - Tooltip": "策略", "Repeated policy rules": "重复的策略", - "Sync": "同步" + "Sync": "同步", + "Sync policies successfully": "同步策略成功" }, "application": { "Always": "始终开启", @@ -36,6 +37,7 @@ "Enable signin session - Tooltip": "从应用登录Casdoor后,Casdoor是否保持会话", "Enable signup": "启用注册", "Enable signup - Tooltip": "是否允许用户注册", + "Failed to sign in": "登录失败", "File uploaded successfully": "文件上传成功", "Form CSS": "表单CSS", "Form CSS - Edit": "编辑表单CSS", @@ -45,6 +47,8 @@ "Grant types": "OAuth授权类型", "Grant types - Tooltip": "选择允许哪些OAuth协议中的Grant types", "Left": "居左", + "Logged in successfully": "登录成功", + "Logged out successfully": "登出成功", "New Application": "添加应用", "None": "关闭", "Password ON": "开启密码",