From 099896a3c6123de60cf7996a7bcef2ad5eec3eab Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 10 Feb 2026 14:55:25 +0000
Subject: [PATCH] Internationalize Advanced Authentication error messages and
dropdown options
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
---
frontend/src/components/EmailSettings.tsx | 24 +++++++++++------------
frontend/src/i18n/locales/de.ts | 24 +++++++++++++++++++++++
frontend/src/i18n/locales/en.ts | 24 +++++++++++++++++++++++
frontend/src/i18n/locales/ja.ts | 24 +++++++++++++++++++++++
4 files changed, 84 insertions(+), 12 deletions(-)
diff --git a/frontend/src/components/EmailSettings.tsx b/frontend/src/components/EmailSettings.tsx
index f095069b2..3fe486baf 100644
--- a/frontend/src/components/EmailSettings.tsx
+++ b/frontend/src/components/EmailSettings.tsx
@@ -54,7 +54,7 @@ export function EmailSettings() {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['smtpSettings'] });
queryClient.invalidateQueries({ queryKey: ['advancedAuthStatus'] });
- showToast('SMTP settings saved successfully', 'success');
+ showToast(t('settings.email.success.settingsSaved'), 'success');
},
onError: (error: Error) => {
showToast(error.message, 'error');
@@ -88,12 +88,12 @@ export function EmailSettings() {
const handleSave = () => {
// Validate required fields
if (!smtpSettings.smtp_host || !smtpSettings.smtp_from_email) {
- showToast('Please fill in all required fields', 'error');
+ showToast(t('settings.email.errors.requiredFields'), 'error');
return;
}
// Validate auth fields when authentication is enabled
if (smtpSettings.smtp_auth_enabled && (!smtpSettings.smtp_username)) {
- showToast('Username is required when authentication is enabled', 'error');
+ showToast(t('settings.email.errors.usernameRequired'), 'error');
return;
}
saveMutation.mutate(smtpSettings);
@@ -101,16 +101,16 @@ export function EmailSettings() {
const handleTest = () => {
if (!testEmail) {
- showToast('Please enter a test email address', 'error');
+ showToast(t('settings.email.errors.enterTestEmail'), 'error');
return;
}
if (!smtpSettings.smtp_host || !smtpSettings.smtp_from_email) {
- showToast('Please fill in SMTP Server and From Email before testing', 'error');
+ showToast(t('settings.email.errors.smtpServerAndEmail'), 'error');
return;
}
// Validate auth fields when authentication is enabled
if (smtpSettings.smtp_auth_enabled && (!smtpSettings.smtp_username || !smtpSettings.smtp_password)) {
- showToast('Username and Password are required when authentication is enabled', 'error');
+ showToast(t('settings.email.errors.usernamePasswordRequired'), 'error');
return;
}
testMutation.mutate({
@@ -127,7 +127,7 @@ export function EmailSettings() {
const handleToggleAdvancedAuth = () => {
if (!advancedAuthStatus?.advanced_auth_enabled && !advancedAuthStatus?.smtp_configured) {
- showToast('Please configure and test SMTP settings first', 'error');
+ showToast(t('settings.email.errors.configureSmtpFirst'), 'error');
return;
}
toggleAdvancedAuthMutation.mutate(!advancedAuthStatus?.advanced_auth_enabled);
@@ -189,9 +189,9 @@ export function EmailSettings() {
onChange={(e) => setSMTPSettings({ ...smtpSettings, smtp_security: e.target.value as 'starttls' | 'ssl' | 'none' })}
className="w-full px-4 py-3 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-bambu-green/50 focus:border-bambu-green transition-colors"
>
-
-
-
+
+
+
@@ -203,8 +203,8 @@ export function EmailSettings() {
onChange={(e) => setSMTPSettings({ ...smtpSettings, smtp_auth_enabled: e.target.value === 'true' })}
className="w-full px-4 py-3 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-bambu-green/50 focus:border-bambu-green transition-colors"
>
-
-
+
+
diff --git a/frontend/src/i18n/locales/de.ts b/frontend/src/i18n/locales/de.ts
index 128f2651e..fa308880e 100644
--- a/frontend/src/i18n/locales/de.ts
+++ b/frontend/src/i18n/locales/de.ts
@@ -1030,6 +1030,30 @@ export default {
feature2: 'Benutzer können sich mit Benutzername oder E-Mail anmelden',
feature3: 'Passwort vergessen Funktion ist verfügbar',
feature4: 'Administratoren können Benutzerpasswörter per E-Mail zurücksetzen',
+ // Error messages
+ errors: {
+ requiredFields: 'Bitte füllen Sie alle Pflichtfelder aus',
+ usernameRequired: 'Benutzername ist erforderlich, wenn Authentifizierung aktiviert ist',
+ enterTestEmail: 'Bitte geben Sie eine Test-E-Mail-Adresse ein',
+ smtpServerAndEmail: 'Bitte füllen Sie SMTP-Server und Absender-E-Mail aus, bevor Sie testen',
+ usernamePasswordRequired: 'Benutzername und Passwort sind erforderlich, wenn Authentifizierung aktiviert ist',
+ configureSmtpFirst: 'Bitte konfigurieren und testen Sie zuerst die SMTP-Einstellungen',
+ },
+ // Success messages
+ success: {
+ settingsSaved: 'SMTP-Einstellungen erfolgreich gespeichert',
+ },
+ // Security options
+ securityOptions: {
+ starttls: 'STARTTLS (Port 587)',
+ ssl: 'SSL/TLS (Port 465)',
+ none: 'Keine (Port 25)',
+ },
+ // Authentication options
+ authOptions: {
+ enabled: 'Aktiviert',
+ disabled: 'Deaktiviert',
+ },
},
appearance: 'Erscheinungsbild',
notifications: 'Benachrichtigungen',
diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts
index 606911122..fd839467d 100644
--- a/frontend/src/i18n/locales/en.ts
+++ b/frontend/src/i18n/locales/en.ts
@@ -1030,6 +1030,30 @@ export default {
feature2: 'Users can login with username or email',
feature3: 'Forgot password feature is available',
feature4: 'Admins can reset user passwords via email',
+ // Error messages
+ errors: {
+ requiredFields: 'Please fill in all required fields',
+ usernameRequired: 'Username is required when authentication is enabled',
+ enterTestEmail: 'Please enter a test email address',
+ smtpServerAndEmail: 'Please fill in SMTP Server and From Email before testing',
+ usernamePasswordRequired: 'Username and Password are required when authentication is enabled',
+ configureSmtpFirst: 'Please configure and test SMTP settings first',
+ },
+ // Success messages
+ success: {
+ settingsSaved: 'SMTP settings saved successfully',
+ },
+ // Security options
+ securityOptions: {
+ starttls: 'STARTTLS (Port 587)',
+ ssl: 'SSL/TLS (Port 465)',
+ none: 'None (Port 25)',
+ },
+ // Authentication options
+ authOptions: {
+ enabled: 'Enabled',
+ disabled: 'Disabled',
+ },
},
appearance: 'Appearance',
notifications: 'Notifications',
diff --git a/frontend/src/i18n/locales/ja.ts b/frontend/src/i18n/locales/ja.ts
index 0b39418ac..fe0f79f12 100644
--- a/frontend/src/i18n/locales/ja.ts
+++ b/frontend/src/i18n/locales/ja.ts
@@ -1182,6 +1182,30 @@ export default {
feature2: 'ユーザーはユーザー名またはメールでログインできます',
feature3: 'パスワード忘れ機能が利用可能です',
feature4: '管理者はメールでユーザーパスワードをリセットできます',
+ // Error messages
+ errors: {
+ requiredFields: 'すべての必須フィールドに入力してください',
+ usernameRequired: '認証が有効な場合、ユーザー名は必須です',
+ enterTestEmail: 'テストメールアドレスを入力してください',
+ smtpServerAndEmail: 'テストする前にSMTPサーバーと送信元メールを入力してください',
+ usernamePasswordRequired: '認証が有効な場合、ユーザー名とパスワードは必須です',
+ configureSmtpFirst: '最初にSMTP設定を構成してテストしてください',
+ },
+ // Success messages
+ success: {
+ settingsSaved: 'SMTP設定を保存しました',
+ },
+ // Security options
+ securityOptions: {
+ starttls: 'STARTTLS (ポート 587)',
+ ssl: 'SSL/TLS (ポート 465)',
+ none: 'なし (ポート 25)',
+ },
+ // Authentication options
+ authOptions: {
+ enabled: '有効',
+ disabled: '無効',
+ },
},
// General - Date/Time