Skip to content

Commit

Permalink
feat: refine i18n resources for login-related page (#6726)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.20.x

#### What this PR does / why we need it:

完善新登录相关页面的多语言资源文件。

#### Which issue(s) this PR fixes:

Fixes #6721

#### Does this PR introduce a user-facing change?

```release-note
None 
```
  • Loading branch information
ruibaby authored Sep 29, 2024
1 parent 2c849d8 commit 1947a54
Show file tree
Hide file tree
Showing 29 changed files with 289 additions and 158 deletions.
5 changes: 2 additions & 3 deletions application/src/main/resources/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ function sendVerificationCode(button, sendRequest) {
sendRequest()
.then(() => {
startCountdown();
Toast.success("发送成功");
Toast.success(i18nResources.sendVerificationCodeSuccess);
})
.catch((e) => {
button.disabled = false;
if (e instanceof Error) {
Toast.error(e.message);
} else {
Toast.error("发送失败,请稍后再试");
Toast.error(i18nResources.sendVerificationCodeFailed);
}
});
});
Expand Down Expand Up @@ -151,4 +151,3 @@ document.addEventListener("DOMContentLoaded", () => {
}
});
});

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title=两步验证
messages.invalidError=错误的验证码
form.code.label=验证码
form.submit=验证
form.submit=验证
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title=Autenticación en Dos Pasos
messages.invalidError=Código de verificación incorrecto
form.code.label=Código de Verificación
form.submit=Verificar
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title=兩步驗證
messages.invalidError=錯誤的驗證碼
form.code.label=驗證碼
form.submit=驗證
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<th:block th:fragment="basicStaticResources">
<link rel="stylesheet" href="/webjars/normalize.css/8.0.1/normalize.css" />
<link rel="stylesheet" th:href="|/styles/main.css?v=${site.version}|" />

<script th:inline="javascript">
const resources = {
title: `[(#{title})]`,
const i18nResources = {
sendVerificationCodeSuccess: `[(#{js.sendVerificationCode.success})]`,
sendVerificationCodeFailed: `[(#{js.sendVerificationCode.failed})]`,
};
</script>

<link rel="stylesheet" href="/webjars/normalize.css/8.0.1/normalize.css" />
<link rel="stylesheet" th:href="|/styles/main.css?v=${site.version}|" />

<script src="/js/main.js"></script>
</th:block>

Expand Down Expand Up @@ -67,7 +68,10 @@
const selectedLanguage = document.getElementById("language-select").value;
const currentURL = new URL(window.location.href);
currentURL.searchParams.set("language", selectedLanguage);
window.location.href = currentURL.toString();

history.replaceState(null, "", currentURL.toString());

window.location.reload();
}
</script>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
socialLogin.label=社交登录
socialLogin.label=社交登录
js.sendVerificationCode.success=发送成功
js.sendVerificationCode.failed=发送失败,请稍后再试
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
socialLogin.label=Social Login
socialLogin.label=Social Login
js.sendVerificationCode.success=Sent Successfully
js.sendVerificationCode.failed=Sending Failed, Please Try Again Later
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
socialLogin.label=Inicio de Sesión Social
js.sendVerificationCode.success=Enviado con éxito
js.sendVerificationCode.failed=Error al enviar, por favor intente nuevamente más tarde
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
socialLogin.label=社交登入
js.sendVerificationCode.success=發送成功
js.sendVerificationCode.failed=發送失敗,請稍後再試
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
messages.loginError=Invalid credentials.
messages.logoutSuccess=Logout successfully.
messages.signupSuccess=Congratulations! Sign up successfully, please sign in now.
messages.signupSuccess=Congratulations! Sign up successfully, please login now.

error.invalid-credential=Invalid credentials.
error.rate-limit-exceeded=Too many requests, please try again later.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
messages.loginError=Credenciales inválidas.
messages.logoutSuccess=Cierre de sesión exitoso.
messages.signupSuccess=¡Felicidades! Registro exitoso, por favor inicie sesión de inmediato.

error.invalid-credential=Credenciales inválidas.
error.rate-limit-exceeded=Demasiadas solicitudes, por favor intente nuevamente más tarde.

form.rememberMe.label=Mantener sesión iniciada
form.submit=Iniciar sesión
otherLogin.label=Otras formas de inicio de sesión
signup.description=¿No tienes una cuenta?
signup.link=Regístrate ahora
returnToSite=Volver al sitio
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
messages.loginError=無效的憑證。
messages.logoutSuccess=登出成功。
messages.signupSuccess=恭喜!註冊成功,請立即登入。

error.invalid-credential=無效的憑證。
error.rate-limit-exceeded=請求過於頻繁,請稍後再試。

form.rememberMe.label=保持登入會話
form.submit=登入
otherLogin.label=其他登入方式
signup.description=沒有帳號?
signup.link=立即註冊
returnToSite=返回網站
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title=Iniciar Sesión
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
form.username.label=Nombre de Usuario
form.password.label=Contraseña
form.password.forgot=¿Olvidaste tu contraseña?
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
form.username.label=使用者名稱
form.password.label=密碼
form.password.forgot=忘記密碼?
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title=登入
3 changes: 3 additions & 0 deletions application/src/main/resources/templates/logout_es.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title=Cerrar Sesión
form.title=¿Estás seguro de que deseas cerrar sesión?
form.submit=Cerrar Sesión
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title=退出登入
form.title=確定要退出登入嗎?
form.submit=退出登入
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ <h1 class="form-title" th:text="#{title(${username})}"></h1>
</div>
</form>
</div>

<div th:replace="~{gateway_modules/common_fragments::languageSwitcher}"></div>
</div>
</th:block>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title=Cambiar Contraseña para {0}
form.password.label=Contraseña
form.confirmPassword.label=Confirmar Contraseña
form.password.tips=La contraseña debe tener al menos 8 caracteres e incluir al menos una letra mayúscula, una letra minúscula, un número y un carácter especial.
form.submit=Cambiar Contraseña
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title=為 {0} 修改密碼
form.password.label=密碼
form.confirmPassword.label=確認密碼
form.password.tips=密碼必須至少包含 8 個字元,並且至少包含一個大寫字母、一個小寫字母、一個數字和一個特殊字元。
form.submit=修改密碼
4 changes: 3 additions & 1 deletion application/src/main/resources/templates/password-reset.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ <h1 class="form-title" th:text="${sent} ? #{sent.title} : #{title}"></h1>
</div>
</form>
</div>

<div th:replace="~{gateway_modules/common_fragments::languageSwitcher}"></div>
</div>
</th:block>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title=Restablecer Contraseña
form.email.label=Correo Electrónico
form.submit=Enviar
sent.form.submit=Volver a la Página de Inicio de Sesión
sent.form.message=Revisa tu correo electrónico para ver el enlace de restablecimiento de contraseña. Si no aparece en unos minutos, revisa tu carpeta de spam.
sent.title=Correo de Restablecimiento de Contraseña Enviado
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title=重置密碼
form.email.label=電子郵件
form.submit=提交
sent.form.submit=返回到登入頁面
sent.form.message=檢查您的電子郵件中是否有重置密碼的連結。如果幾分鐘內沒有出現,請檢查您的垃圾郵件資料夾。
sent.title=已發送重置密碼的郵件
Loading

0 comments on commit 1947a54

Please sign in to comment.