feat: replace hardcoded English text with i18n translations

Update page.tsx password dialog with i18n translations for multilingual support.

Co-authored-by: Simon <85533298+handsomezhuzhu@users.noreply.github.com>
This commit is contained in:
v0
2026-03-21 12:00:19 +00:00
parent bf4433a054
commit 9a3c12f69e
2 changed files with 13 additions and 5 deletions

View File

@@ -1196,14 +1196,14 @@ export default function TwoFactorAuth() {
<Dialog open={showExportPassword} onOpenChange={setShowExportPassword}>
<DialogContent>
<DialogHeader>
<DialogTitle>Set Export Password</DialogTitle>
<DialogTitle>{t.setExportPassword}</DialogTitle>
</DialogHeader>
<div className="space-y-4 py-4">
<div className="space-y-2">
<Label>Password</Label>
<Input
type="password"
placeholder="Enter a password to protect your backup"
placeholder={t.passwordPlaceholder}
value={exportPassword}
onChange={(e) => setExportPassword(e.target.value)}
/>
@@ -1236,11 +1236,11 @@ export default function TwoFactorAuth() {
}}>
<DialogContent>
<DialogHeader>
<DialogTitle>Import Backup</DialogTitle>
<DialogTitle>{t.importBackup}</DialogTitle>
</DialogHeader>
<div className="space-y-4 py-4">
<div className="space-y-2">
<Label>Select File</Label>
<Label>{t.selectFile}</Label>
<Input
type="file"
accept=".enc"
@@ -1253,7 +1253,7 @@ export default function TwoFactorAuth() {
<Label>Password</Label>
<Input
type="password"
placeholder="Enter the password for this backup"
placeholder={t.passwordInput}
value={importPassword}
onChange={(e) => setImportPassword(e.target.value)}
/>

View File

@@ -116,6 +116,10 @@ const translations = {
imageLoadFailed: "图片加载失败",
duplicateToken: "令牌已存在",
duplicateTokenDesc: "该密钥的令牌已添加过",
setExportPassword: "设置导出密码",
passwordPlaceholder: "输入密码以保护您的备份",
selectFile: "选择文件",
passwordInput: "输入备份密码",
},
en: {
// Header
@@ -227,6 +231,10 @@ const translations = {
imageLoadFailed: "Failed to load image",
duplicateToken: "Token already exists",
duplicateTokenDesc: "A token with this secret key has already been added",
setExportPassword: "Set Export Password",
passwordPlaceholder: "Enter a password to protect your backup",
selectFile: "Select File",
passwordInput: "Enter backup password",
},
}