finish i18n for now

This commit is contained in:
wjqserver 2025-07-01 09:12:31 +08:00
parent 79e3db6078
commit d4e7f83131
5 changed files with 75 additions and 21 deletions

View file

@ -69,7 +69,7 @@
<legend data-i18n="form.legend_basic">基础配置</legend>
<div class="form-group">
<label for="domain" data-i18n="form.domain_label">主域名 (将用作文件名)</label>
<input type="text" id="domain" name="domain" required>
<input type="text" id="domain" name="domain">
</div>
</fieldset>

View file

@ -40,7 +40,7 @@
</div>
<div class="language-switcher-corner">
<button id="lang-switcher-btn" class="btn-icon" data-i18n-title="common.switch_language" title="切换语言">
<button id="lang-switcher-btn" class="btn-icon" data-i18n-title="common.switch_language">
<i class="fa-solid fa-language"></i>
</button>
<ul id="lang-options-list" class="hidden"></ul>

View file

@ -51,7 +51,8 @@
"new_password_label": "New Password (min. 8 characters)",
"confirm_new_password_label": "Confirm New Password",
"reset_password_btn": "Reset Password",
"resetting_password_btn": "Resetting..."
"resetting_password_btn": "Resetting...",
"interface_settings_title": "Interface Settings"
},
"login": {
"page_title": "Login - CaddyDash",
@ -98,7 +99,31 @@
"legend_features": "Additional Features",
"feature_log": "Enable Logging",
"feature_error_page": "Enable Custom Error Pages",
"feature_encode": "Enable Compression"
"feature_encode": "Enable Compression",
"legend_general_options": "General Options",
"admin_api_port_label": "Admin API Port (Read-only)",
"http_port_label": "HTTP Port",
"https_port_label": "HTTPS Port",
"enable_debug_mode": "Enable Debug Mode",
"enable_prometheus_metrics": "Enable Prometheus Metrics",
"legend_main_log_config": "Main Log Configuration",
"log_level_label": "Log Level",
"log_rotate_size_label": "Rotate Size",
"log_rotate_size_placeholder": "e.g., 10MB",
"log_rotate_keep_label": "Retain Files",
"log_rotate_keep_placeholder": "e.g., 10",
"log_rotate_keep_for_time_label": "Retain Time",
"log_rotate_keep_for_time_placeholder": "e.g., 24h",
"legend_global_tls_config": "Global TLS Configuration (ACME)",
"enable_global_dns_challenge": "Enable Global DNS Challenge",
"dns_provider_label": "DNS Provider",
"acme_email_label": "ACME Email",
"acme_email_placeholder": "For certificate application and renewal notifications",
"api_token_label": "API Token (or equivalent credentials)",
"legend_ech_config": "Encrypted Client Hello (ECH)",
"enable_ech_experimental": "Enable ECH (Experimental)",
"ech_outer_sni_label": "ECH Outer SNI",
"ech_outer_sni_placeholder": "e.g., ech.example.com"
},
"dialogs": {
"unsaved_changes_title": "Unsaved Changes",
@ -135,6 +160,8 @@
"init_error_mismatch": "Passwords do not match.",
"init_error_short": "Password must be at least {minLength} characters long.",
"init_success": "Setup complete! Redirecting to login...",
"init_error_generic": "Initialization failed. Please try again."
"init_error_generic": "Initialization failed. Please try again.",
"error_all_fields_required": "All fields are required.",
"pwd_reset_success": "Password reset successfully. Please log in with your new password."
}
}

View file

@ -51,7 +51,8 @@
"new_password_label": "新密码 (至少8位)",
"confirm_new_password_label": "确认新密码",
"reset_password_btn": "重置密码",
"resetting_password_btn": "重置中..."
"resetting_password_btn": "重置中...",
"interface_settings_title": "界面设置"
},
"login": {
"page_title": "登录 - CaddyDash",
@ -98,7 +99,31 @@
"legend_features": "附加功能",
"feature_log": "启用日志",
"feature_error_page": "启用错误页",
"feature_encode": "启用压缩"
"feature_encode": "启用压缩",
"legend_general_options": "通用选项",
"admin_api_port_label": "管理API端口 (只读)",
"http_port_label": "HTTP 端口",
"https_port_label": "HTTPS 端口",
"enable_debug_mode": "启用Debug模式",
"enable_prometheus_metrics": "启用Prometheus指标",
"legend_main_log_config": "主日志配置",
"log_level_label": "日志级别",
"log_rotate_size_label": "滚动大小",
"log_rotate_size_placeholder": "例如: 10MB",
"log_rotate_keep_label": "保留文件数",
"log_rotate_keep_placeholder": "例如: 10",
"log_rotate_keep_for_time_label": "保留时间",
"log_rotate_keep_for_time_placeholder": "例如: 24h",
"legend_global_tls_config": "全局TLS配置 (ACME)",
"enable_global_dns_challenge": "启用全局 DNS Challenge",
"dns_provider_label": "DNS 提供商",
"acme_email_label": "ACME 邮箱",
"acme_email_placeholder": "用于证书申请和续订通知",
"api_token_label": "API Token (或等效凭证)",
"legend_ech_config": "加密客户端问候 (ECH)",
"enable_ech_experimental": "启用 ECH (实验性功能)",
"ech_outer_sni_label": "ECH Outer SNI",
"ech_outer_sni_placeholder": "例如: ech.example.com"
},
"dialogs": {
"unsaved_changes_title": "未保存的更改",

View file

@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>面板设置 - CaddyDash</title>
<title data-i18n="pages.settings.page_title">面板设置 - CaddyDash</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
@ -21,11 +21,12 @@
</header>
<nav class="sidebar-nav">
<ul>
<li><a href="/" data-nav-id="configs"><i class="fa-solid fa-sitemap"></i> <span>配置管理</span></a></li>
<li><a href="/" data-nav-id="configs"><i class="fa-solid fa-sitemap"></i> <span
data-i18n="nav.configs">配置管理</span></a></li>
<li><a href="/global.html" data-nav-id="global"><i class="fa-solid fa-globe"></i>
<span>全局配置</span></a></li>
<span data-i18n="nav.global">全局配置</span></a></li>
<li><a href="/settings.html" data-nav-id="settings"><i class="fa-solid fa-gears"></i>
<span>面板设置</span></a></li>
<span data-i18n="nav.settings">面板设置</span></a></li>
</ul>
</nav>
<div class="sidebar-bottom">
@ -34,52 +35,52 @@
</div>
<div class="caddy-control-panel">
<div id="caddy-status-indicator" class="caddy-status"><span class="status-dot checking"></span><span
class="status-text">检查中...</span></div>
class="status-text" data-i18n="status.checking">检查中...</span></div>
<div id="caddy-action-button-container"></div>
</div>
<div class="logout-section"><button id="logout-btn" class="btn btn-secondary"><i
class="fa-solid fa-right-from-bracket"></i><span>退出登录</span></button></div>
class="fa-solid fa-right-from-bracket"></i><span data-i18n="nav.logout">退出登录</span></button></div>
</div>
</aside>
<main class="main-content">
<header class="main-header">
<button class="btn-icon" id="menu-toggle-btn"><i class="fa-solid fa-bars"></i></button>
<h2>面板设置</h2>
<h2 data-i18n="pages.settings.title">面板设置</h2>
</header>
<div id="view-container">
<section class="card-panel">
<h3 data-i18n="settings_language_title">界面设置</h3>
<h3 data-i18n="pages.settings.interface_settings_title">界面设置</h3>
<div class="form-group" style="margin-top: 16px;">
<label for="select-language" data-i18n="pages.settings.language_label">语言</label>
<div id="select-language" class="custom-select"></div>
</div>
</section>
<section class="card-panel">
<h3>账户安全</h3>
<h3 data-i18n="pages.settings.account_security_title">账户安全</h3>
<form id="reset-password-form" style="margin-top: 24px;">
<div class="form-group">
<label for="username">用户名</label>
<label for="username" data-i18n="pages.login.username_label">用户名</label>
<input type="text" id="username" name="username" autocomplete="username">
</div>
<div class="form-group">
<label for="old_password">当前密码</label>
<label for="old_password" data-i18n="pages.settings.current_password_label">当前密码</label>
<input type="password" id="old_password" name="old_password"
autocomplete="current-password">
</div>
<div class="form-group">
<label for="new_password">新密码 (至少8位)</label>
<label for="new_password" data-i18n="pages.settings.new_password_label">新密码 (至少8位)</label>
<input type="password" id="new_password" name="new_password" autocomplete="new-password">
</div>
<div class="form-group">
<label for="confirm_new_password">确认新密码</label>
<label for="confirm_new_password" data-i18n="pages.settings.confirm_new_password_label">确认新密码</label>
<input type="password" id="confirm_new_password" name="confirm_new_password"
autocomplete="new-password">
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-key"></i>
<span>重置密码</span></button>
<span data-i18n="pages.settings.reset_password_btn">重置密码</span></button>
</div>
</form>
</section>
@ -89,6 +90,7 @@
<div id="toast-container" class="toast-container"></div>
<div id="dialog-container"></div>
<div id="modal-container"></div> <!-- 模态框容器也应在此页面存在因为notifications.js会用到 -->
<script type="module" src="js/common.js"></script>
<script type="module" src="js/settings.js"></script>