Skip to content

Commit

Permalink
Modal Password translation complement
Browse files Browse the repository at this point in the history
  • Loading branch information
ux-builder committed Jul 14, 2024
1 parent f086855 commit 3f43b85
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 11 deletions.
21 changes: 13 additions & 8 deletions frontend/src/components/Modals/Password/MultiUserAuth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ModalWrapper from "@/components/ModalWrapper";
import { useModal } from "@/hooks/useModal";
import RecoveryCodeModal from "@/components/Modals/DisplayRecoveryCodeModal";
import { useTranslation } from "react-i18next";
import { t } from "i18next";

const RecoveryForm = ({ onSubmit, setShowRecoveryForm }) => {
const [username, setUsername] = useState("");
Expand Down Expand Up @@ -36,21 +37,23 @@ const RecoveryForm = ({ onSubmit, setShowRecoveryForm }) => {
<div className="flex items-start justify-between pt-11 pb-9 w-screen md:w-full md:px-12 px-6 ">
<div className="flex flex-col gap-y-4 w-full">
<h3 className="text-4xl md:text-lg font-bold text-white text-center md:text-left">
Password Reset
{t("login.password-reset.title")}
</h3>
<p className="text-sm text-white/90 md:text-left md:max-w-[300px] px-4 md:px-0 text-center">
Provide the necessary information below to reset your password.
{t("login.password-reset.description")}
</p>
</div>
</div>
<div className="md:px-12 px-6 space-y-6 flex h-full w-full">
<div className="w-full flex flex-col gap-y-4">
<div className="flex flex-col gap-y-2">
<label className="text-white text-sm font-bold">Username</label>
<label className="text-white text-sm font-bold">
{t("login.multi-user.placeholder-username")}
</label>
<input
name="username"
type="text"
placeholder="Username"
placeholder={t("login.multi-user.placeholder-username")}
value={username}
onChange={(e) => setUsername(e.target.value)}
className="bg-zinc-900 text-white placeholder-white/20 text-sm rounded-md p-2.5 w-full h-[48px] md:w-[300px] md:h-[34px]"
Expand All @@ -59,14 +62,16 @@ const RecoveryForm = ({ onSubmit, setShowRecoveryForm }) => {
</div>
<div className="flex flex-col gap-y-2">
<label className="text-white text-sm font-bold">
Recovery Codes
{t("login.password-reset.recovery-codes")}
</label>
{recoveryCodeInputs.map((code, index) => (
<div key={index}>
<input
type="text"
name={`recoveryCode${index + 1}`}
placeholder={`Recovery Code ${index + 1}`}
placeholder={t("login.password-reset.recovery-code", {
index: index + 1,
})}
value={code}
onChange={(e) =>
handleRecoveryCodeChange(index, e.target.value)
Expand All @@ -84,14 +89,14 @@ const RecoveryForm = ({ onSubmit, setShowRecoveryForm }) => {
type="submit"
className="md:text-primary-button md:bg-transparent md:w-[300px] text-dark-text text-sm font-bold focus:ring-4 focus:outline-none rounded-md border-[1.5px] border-primary-button md:h-[34px] h-[48px] md:hover:text-white md:hover:bg-primary-button bg-primary-button focus:z-10 w-full"
>
Reset Password
{t("login.password-reset.title")}
</button>
<button
type="button"
className="text-white text-sm flex gap-x-1 hover:text-primary-button hover:underline -mb-8"
onClick={() => setShowRecoveryForm(false)}
>
Back to Login
{t("login.password-reset.back-to-login")}
</button>
</div>
</form>
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/locales/en/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ const TRANSLATIONS = {
start: "Sign in to your",
end: "account.",
},
"password-reset": {
title: "Password Reset",
description:
"Provide the necessary information below to reset your password.",
"recovery-codes": "Recovery Codes",
"recovery-code": "Recovery Code {{index}}",
"back-to-login": "Back to Login",
},
},

// Workspace Settings menu items
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/locales/es/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ const TRANSLATIONS = {
start: "Iniciar sesión en tu",
end: "cuenta.",
},
"password-reset": {
title: "Restablecer la contraseña",
description:
"Proporcione la información necesaria a continuación para restablecer su contraseña.",
"recovery-codes": "Códigos de recuperación",
"recovery-code": "Código de recuperación {{index}}",
"back-to-login": "Volver al inicio de sesión",
},
},

"workspaces—settings": {
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/locales/fr/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ const TRANSLATIONS = {
start: "Connectez-vous à votre",
end: "compte.",
},
"password-reset": {
title: "Réinitialisation du mot de passe",
description:
"Fournissez les informations nécessaires ci-dessous pour réinitialiser votre mot de passe.",
"recovery-codes": "Codes de récupération",
"recovery-code": "Code de récupération {{index}}",
"back-to-login": "Retour à la connexion",
},
},

// Workspace Settings menu items
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/locales/ko/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const TRANSLATIONS = {
// Page Definitions
login: {
"multi-user": {
welcome: "환영합니다",
welcome: "웰컴!",
"placeholder-username": "사용자 이름",
"placeholder-password": "비밀번호",
login: "로그인",
Expand All @@ -49,8 +49,15 @@ const TRANSLATIONS = {
reset: "재설정",
},
"sign-in": {
start: "계정으로",
end: "로그인하세요.",
start: "사용자 계정으로 ",
end: "에 로그인하세요.",
},
"password-reset": {
title: "비밀번호 재설정",
description: "비밀번호를 재설정하려면 아래에 필요한 정보를 입력하세요.",
"recovery-codes": "복구 코드",
"recovery-code": "복구 코드 {{index}}",
"back-to-login": "로그인으로 돌아가기",
},
},

Expand Down
8 changes: 8 additions & 0 deletions frontend/src/locales/ru/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ const TRANSLATIONS = {
start: "Войти в ваш",
end: "аккаунт.",
},
"password-reset": {
title: "Сброс пароля",
description:
"Предоставьте необходимую информацию ниже, чтобы сбросить ваш пароль.",
"recovery-codes": "Коды восстановления",
"recovery-code": "Код восстановления {{index}}",
"back-to-login": "Вернуться к входу",
},
},
"workspaces—settings": {
general: "Общие настройки",
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/locales/zh/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const TRANSLATIONS = {
start: "登录你的",
end: "账户",
},
"password-reset": {
title: "重置密码",
description: "请提供以下必要信息以重置您的密码。",
"recovery-codes": "恢复代码",
"recovery-code": "恢复代码 {{index}}",
"back-to-login": "返回登录",
},
},

// Workspace Settings menu items
Expand Down

0 comments on commit 3f43b85

Please sign in to comment.