Commit 0b02012c authored by ThinhNC's avatar ThinhNC

feat(i18n): localize account handover OTP prompt in English and Vietnamese

parent 3c4a1811
......@@ -2464,7 +2464,11 @@
"cancelTransfer": "Cancel Handover",
"cancelled": "Handover session cancelled",
"targetConnected": "New Account Connected!",
"targetUserDefault": "New Zalo user",
"otpAuthNotice": "Two-way Mutual Authorization:",
"otpPromptDescription": "A 6-digit OTP verification code has been sent to {{email}}. Please enter the code to authorize transferring all data to account {{targetName}}.",
"otpPromptDefault": "Please enter the 6-digit OTP code to authorize the account ownership transfer.",
"targetUserFallback": "new account",
"otpEmailSentTitle": "OTP Sent to Email",
"otpEmailSentDesc": "Check your inbox (or Spam/Junk folder) of:",
"otpInputLabel": "OTP Authorization Code (6 digits)",
......
......@@ -2565,7 +2565,11 @@
"cancelTransfer": "Hủy Phiên Chuyển Giao",
"cancelled": "Đã hủy phiên chuyển giao",
"targetConnected": "Tài Khoản Mới Đã Kết Nối!",
"targetUserDefault": "Người dùng Zalo mới",
"otpAuthNotice": "Xác thực bảo mật 2 chiều:",
"otpPromptDescription": "Mã xác thực OTP gồm 6 chữ số đã được gửi đến email {{email}}. Vui lòng nhập mã để xác nhận chuyển toàn bộ dữ liệu sang tài khoản {{targetName}}.",
"otpPromptDefault": "Vui lòng nhập mã OTP gồm 6 chữ số để ký duyệt lệnh chuyển giao quyền sở hữu.",
"targetUserFallback": "mới",
"otpEmailSentTitle": "Đã gửi mã OTP qua Email",
"otpEmailSentDesc": "Kiểm tra hộp thư đến (hoặc hòm thư Rác/Spam) của:",
"otpInputLabel": "Mã xác thực OTP (6 chữ số)",
......
......@@ -57,6 +57,7 @@ export const AccountHandoverPage: React.FC = () => {
const [targetUserName, setTargetUserName] = useState<string>("");
const [otpPrompt, setOtpPrompt] = useState<string>("");
const [otpDevCode, setOtpDevCode] = useState<string>("");
const [maskedEmail, setMaskedEmail] = useState<string>("");
const [otpInput, setOtpInput] = useState<string>("");
const [senderTimeLeft, setSenderTimeLeft] = useState<number>(900);
const [isInitiating, setIsInitiating] = useState<boolean>(false);
......@@ -162,6 +163,12 @@ export const AccountHandoverPage: React.FC = () => {
if (statusRes.targetUserName) setTargetUserName(statusRes.targetUserName);
if (statusRes.otpPrompt) setOtpPrompt(statusRes.otpPrompt);
if (statusRes.otpCodeDev) setOtpDevCode(statusRes.otpCodeDev);
if (statusRes.sourceUserEmailMasked) {
setMaskedEmail(statusRes.sourceUserEmailMasked);
} else if (statusRes.otpPrompt) {
const emailMatch = statusRes.otpPrompt.match(/email\s+([^\s,]+)/i);
if (emailMatch?.[1]) setMaskedEmail(emailMatch[1]);
}
} else if (statusRes.status === "EXPIRED") {
setSenderStatus("EXPIRED");
}
......@@ -222,6 +229,7 @@ export const AccountHandoverPage: React.FC = () => {
setSenderStatus("IDLE");
setInitiateData(null);
setOtpInput("");
setMaskedEmail("");
openSnackbar({
type: "info",
text: t("handover.cancelled") || "Đã hủy phiên chuyển giao",
......@@ -604,7 +612,7 @@ export const AccountHandoverPage: React.FC = () => {
{t("handover.targetConnected") || "Tài Khoản Mới Đã Kết Nối!"}
</span>
<span className="font-baloo font-bold text-sm sm:text-base text-clay-text block">
{targetUserName || "Người dùng Zalo mới"}
{targetUserName?.trim() || t("handover.targetUserDefault") || "Người dùng Zalo mới"}
</span>
</div>
</div>
......@@ -617,8 +625,13 @@ export const AccountHandoverPage: React.FC = () => {
{t("handover.otpAuthNotice") || "Xác thực bảo mật 2 chiều:"}
</span>
<span>
{otpPrompt ||
"Vui lòng nhập mã OTP gồm 6 chữ số để ký duyệt lệnh chuyển giao quyền sở hữu."}
{maskedEmail
? t("handover.otpPromptDescription", {
email: maskedEmail,
targetName: targetUserName?.trim() || t("handover.targetUserFallback") || "mới",
})
: t("handover.otpPromptDefault") ||
"Vui lòng nhập mã OTP gồm 6 chữ số để ký duyệt lệnh chuyển giao quyền sở hữu."}
</span>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment