Skip to content

Commit 6557154

Browse files
enkoclaude
andcommitted
fix(frontend): Translate hardcoded strings in CardDAVSetupGuide component
The CardDAV setup guide had all its strings hardcoded in English (server URL header, copy button, setup steps, field labels, important notice). Wire up existing profile.carddav.* i18n keys and add new keys for the step-by-step instructions and field labels in both en.json and de.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 45722f4 commit 6557154

File tree

3 files changed

+126
-44
lines changed

3 files changed

+126
-44
lines changed

apps/frontend/src/lib/components/CardDAVSetupGuide.svelte

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<script lang="ts">
22
import ExclamationTriangle from 'svelte-heros-v2/ExclamationTriangle.svelte';
3+
import { createI18n } from '$lib/i18n/index.js';
34
import { currentUser } from '$lib/stores/auth';
45
6+
const i18n = createI18n();
7+
58
interface Props {
69
serverUrl?: string;
710
}
@@ -41,7 +44,7 @@ async function copyUrl() {
4144

4245
<div class="space-y-6">
4346
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
44-
<h4 class="font-body font-semibold text-blue-800 mb-2">CardDAV Server URL</h4>
47+
<h4 class="font-body font-semibold text-blue-800 mb-2">{$i18n.t('profile.carddav.serverUrl')}</h4>
4548
<div class="flex items-center gap-2">
4649
<code class="flex-1 bg-white border border-blue-200 rounded px-3 py-2 font-mono text-sm break-all">
4750
{carddavUrl}
@@ -50,11 +53,11 @@ async function copyUrl() {
5053
onclick={copyUrl}
5154
class="shrink-0 bg-blue-600 text-white px-3 py-2 rounded font-body text-sm hover:bg-blue-700 transition-colors"
5255
>
53-
{copied ? 'Copied!' : 'Copy'}
56+
{copied ? $i18n.t('profile.carddav.copied') : $i18n.t('profile.carddav.copy')}
5457
</button>
5558
</div>
5659
<p class="font-body text-xs text-blue-600 mt-2">
57-
Use your email <strong>{$currentUser?.email}</strong> and an app password to sign in.
60+
{$i18n.t('profile.carddav.useCredentials', { email: $currentUser?.email })}
5861
</p>
5962
</div>
6063

@@ -64,74 +67,74 @@ async function copyUrl() {
6467
onclick={() => activeTab = 'ios'}
6568
class="flex-1 px-4 py-3 font-body font-medium text-sm transition-colors {activeTab === 'ios' ? 'bg-white text-forest border-b-2 border-forest' : 'bg-gray-50 text-gray-600 hover:text-gray-800'}"
6669
>
67-
iOS / iPadOS
70+
{$i18n.t('profile.carddav.ios')}
6871
</button>
6972
<button
7073
onclick={() => activeTab = 'macos'}
7174
class="flex-1 px-4 py-3 font-body font-medium text-sm transition-colors {activeTab === 'macos' ? 'bg-white text-forest border-b-2 border-forest' : 'bg-gray-50 text-gray-600 hover:text-gray-800'}"
7275
>
73-
macOS
76+
{$i18n.t('profile.carddav.macos')}
7477
</button>
7578
<button
7679
onclick={() => activeTab = 'thunderbird'}
7780
class="flex-1 px-4 py-3 font-body font-medium text-sm transition-colors {activeTab === 'thunderbird' ? 'bg-white text-forest border-b-2 border-forest' : 'bg-gray-50 text-gray-600 hover:text-gray-800'}"
7881
>
79-
Thunderbird
82+
{$i18n.t('profile.carddav.thunderbird')}
8083
</button>
8184
</div>
8285

8386
<div class="p-4">
8487
{#if activeTab === 'ios'}
8588
<ol class="list-decimal list-inside space-y-3 font-body text-gray-700">
86-
<li>Open <strong>Settings</strong> and tap <strong>Contacts</strong></li>
87-
<li>Tap <strong>Accounts</strong>, then <strong>Add Account</strong></li>
88-
<li>Select <strong>Other</strong> at the bottom</li>
89-
<li>Tap <strong>Add CardDAV Account</strong></li>
89+
<li>{@html $i18n.t('profile.carddav.steps.ios.1')}</li>
90+
<li>{@html $i18n.t('profile.carddav.steps.ios.2')}</li>
91+
<li>{@html $i18n.t('profile.carddav.steps.ios.3')}</li>
92+
<li>{@html $i18n.t('profile.carddav.steps.ios.4')}</li>
9093
<li>
91-
Enter your details:
94+
{@html $i18n.t('profile.carddav.steps.ios.5')}
9295
<ul class="list-disc list-inside ml-4 mt-2 space-y-1 text-sm text-gray-600">
93-
<li><strong>Server:</strong> {carddavUrl}</li>
94-
<li><strong>User Name:</strong> {$currentUser?.email}</li>
95-
<li><strong>Password:</strong> Your app password</li>
96-
<li><strong>Description:</strong> Freundebuch</li>
96+
<li><strong>{$i18n.t('profile.carddav.fields.server')}</strong> {carddavUrl}</li>
97+
<li><strong>{$i18n.t('profile.carddav.fields.userName')}</strong> {$currentUser?.email}</li>
98+
<li><strong>{$i18n.t('profile.carddav.fields.password')}</strong> {$i18n.t('profile.carddav.fields.yourAppPassword')}</li>
99+
<li><strong>{$i18n.t('profile.carddav.fields.description')}</strong> Freundebuch</li>
97100
</ul>
98101
</li>
99-
<li>Tap <strong>Next</strong> to verify and save</li>
102+
<li>{@html $i18n.t('profile.carddav.steps.ios.6')}</li>
100103
</ol>
101104
{:else if activeTab === 'macos'}
102105
<ol class="list-decimal list-inside space-y-3 font-body text-gray-700">
103-
<li>Open <strong>System Settings</strong> (or System Preferences)</li>
104-
<li>Click <strong>Internet Accounts</strong></li>
105-
<li>Click <strong>Add Account</strong>, then select <strong>Other Contacts Account</strong></li>
106-
<li>Select <strong>CardDAV</strong> as the account type</li>
106+
<li>{@html $i18n.t('profile.carddav.steps.macos.1')}</li>
107+
<li>{@html $i18n.t('profile.carddav.steps.macos.2')}</li>
108+
<li>{@html $i18n.t('profile.carddav.steps.macos.3')}</li>
109+
<li>{@html $i18n.t('profile.carddav.steps.macos.4')}</li>
107110
<li>
108-
Enter your details:
111+
{@html $i18n.t('profile.carddav.steps.macos.5')}
109112
<ul class="list-disc list-inside ml-4 mt-2 space-y-1 text-sm text-gray-600">
110-
<li><strong>Account Type:</strong> Manual</li>
111-
<li><strong>User Name:</strong> {$currentUser?.email}</li>
112-
<li><strong>Password:</strong> Your app password</li>
113-
<li><strong>Server Address:</strong> {carddavUrl}</li>
113+
<li><strong>{$i18n.t('profile.carddav.fields.accountType')}</strong> {$i18n.t('profile.carddav.fields.manual')}</li>
114+
<li><strong>{$i18n.t('profile.carddav.fields.userName')}</strong> {$currentUser?.email}</li>
115+
<li><strong>{$i18n.t('profile.carddav.fields.password')}</strong> {$i18n.t('profile.carddav.fields.yourAppPassword')}</li>
116+
<li><strong>{$i18n.t('profile.carddav.fields.serverAddress')}</strong> {carddavUrl}</li>
114117
</ul>
115118
</li>
116-
<li>Click <strong>Sign In</strong></li>
119+
<li>{@html $i18n.t('profile.carddav.steps.macos.6')}</li>
117120
</ol>
118121
{:else if activeTab === 'thunderbird'}
119122
<ol class="list-decimal list-inside space-y-3 font-body text-gray-700">
120-
<li>Install the <strong>CardBook</strong> add-on from Thunderbird Add-ons</li>
121-
<li>Open <strong>CardBook</strong> from the Thunderbird menu</li>
122-
<li>Click <strong>Address Book</strong> &rarr; <strong>New Address Book</strong></li>
123-
<li>Select <strong>Remote</strong> and click <strong>Next</strong></li>
124-
<li>Select <strong>CardDAV</strong> and click <strong>Next</strong></li>
123+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.1')}</li>
124+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.2')}</li>
125+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.3')}</li>
126+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.4')}</li>
127+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.5')}</li>
125128
<li>
126-
Enter your details:
129+
{@html $i18n.t('profile.carddav.steps.thunderbird.6')}
127130
<ul class="list-disc list-inside ml-4 mt-2 space-y-1 text-sm text-gray-600">
128-
<li><strong>URL:</strong> {carddavUrl}</li>
129-
<li><strong>User:</strong> {$currentUser?.email}</li>
130-
<li><strong>Password:</strong> Your app password</li>
131+
<li><strong>{$i18n.t('profile.carddav.fields.url')}</strong> {carddavUrl}</li>
132+
<li><strong>{$i18n.t('profile.carddav.fields.user')}</strong> {$currentUser?.email}</li>
133+
<li><strong>{$i18n.t('profile.carddav.fields.password')}</strong> {$i18n.t('profile.carddav.fields.yourAppPassword')}</li>
131134
</ul>
132135
</li>
133-
<li>Click <strong>Validate</strong> to verify the connection</li>
134-
<li>Select the address book and complete the setup</li>
136+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.7')}</li>
137+
<li>{@html $i18n.t('profile.carddav.steps.thunderbird.8')}</li>
135138
</ol>
136139
{/if}
137140
</div>
@@ -141,10 +144,9 @@ async function copyUrl() {
141144
<div class="flex items-start gap-2">
142145
<ExclamationTriangle class="w-5 h-5 text-yellow-600 shrink-0 mt-0.5" strokeWidth="2" />
143146
<div>
144-
<h4 class="font-body font-semibold text-yellow-800">Important</h4>
147+
<h4 class="font-body font-semibold text-yellow-800">{$i18n.t('profile.carddav.important')}</h4>
145148
<p class="font-body text-sm text-yellow-700 mt-1">
146-
Always use an <strong>app password</strong> instead of your regular account password.
147-
App passwords can be revoked individually without changing your main password.
149+
{@html $i18n.t('profile.carddav.importantNote')}
148150
</p>
149151
</div>
150152
</div>

apps/frontend/src/lib/i18n/locales/de.json

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,50 @@
618618
"setupGuide": "Einrichtungsanleitung",
619619
"useCredentials": "Verwende deine E-Mail {{email}} und ein App-Passwort zum Anmelden.",
620620
"important": "Wichtig",
621-
"importantNote": "Verwende immer ein App-Passwort anstelle deines regulären Kontopassworts für CardDAV-Clients.",
621+
"importantNote": "Verwende immer ein <strong>App-Passwort</strong> anstelle deines regulären Kontopassworts. App-Passwörter können einzeln widerrufen werden, ohne dein Hauptpasswort zu ändern.",
622622
"ios": "iOS / iPadOS",
623623
"macos": "macOS",
624-
"thunderbird": "Thunderbird"
624+
"thunderbird": "Thunderbird",
625+
"fields": {
626+
"server": "Server:",
627+
"userName": "Benutzername:",
628+
"password": "Passwort:",
629+
"yourAppPassword": "Dein App-Passwort",
630+
"description": "Beschreibung:",
631+
"accountType": "Kontotyp:",
632+
"manual": "Manuell",
633+
"serverAddress": "Serveradresse:",
634+
"url": "URL:",
635+
"user": "Benutzer:"
636+
},
637+
"steps": {
638+
"ios": {
639+
"1": "Öffne <strong>Einstellungen</strong> und tippe auf <strong>Kontakte</strong>",
640+
"2": "Tippe auf <strong>Accounts</strong>, dann auf <strong>Account hinzufügen</strong>",
641+
"3": "Wähle <strong>Andere</strong> ganz unten",
642+
"4": "Tippe auf <strong>CardDAV-Account hinzufügen</strong>",
643+
"5": "Gib deine Daten ein:",
644+
"6": "Tippe auf <strong>Weiter</strong> zum Überprüfen und Speichern"
645+
},
646+
"macos": {
647+
"1": "Öffne <strong>Systemeinstellungen</strong>",
648+
"2": "Klicke auf <strong>Internetaccounts</strong>",
649+
"3": "Klicke auf <strong>Account hinzufügen</strong>, dann wähle <strong>Anderer Kontakte-Account</strong>",
650+
"4": "Wähle <strong>CardDAV</strong> als Kontotyp",
651+
"5": "Gib deine Daten ein:",
652+
"6": "Klicke auf <strong>Anmelden</strong>"
653+
},
654+
"thunderbird": {
655+
"1": "Installiere das <strong>CardBook</strong>-Add-on aus den Thunderbird-Add-ons",
656+
"2": "Öffne <strong>CardBook</strong> über das Thunderbird-Menü",
657+
"3": "Klicke auf <strong>Adressbuch</strong> &rarr; <strong>Neues Adressbuch</strong>",
658+
"4": "Wähle <strong>Entfernt</strong> und klicke auf <strong>Weiter</strong>",
659+
"5": "Wähle <strong>CardDAV</strong> und klicke auf <strong>Weiter</strong>",
660+
"6": "Gib deine Daten ein:",
661+
"7": "Klicke auf <strong>Überprüfen</strong>, um die Verbindung zu testen",
662+
"8": "Wähle das Adressbuch aus und schließe die Einrichtung ab"
663+
}
664+
}
625665
},
626666
"danger": {
627667
"title": "Gefahrenzone",

apps/frontend/src/lib/i18n/locales/en.json

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,50 @@
618618
"setupGuide": "Setup Guide",
619619
"useCredentials": "Use your email {{email}} and an app password to sign in.",
620620
"important": "Important",
621-
"importantNote": "Always use an app password instead of your regular account password for CardDAV clients.",
621+
"importantNote": "Always use an <strong>app password</strong> instead of your regular account password. App passwords can be revoked individually without changing your main password.",
622622
"ios": "iOS / iPadOS",
623623
"macos": "macOS",
624-
"thunderbird": "Thunderbird"
624+
"thunderbird": "Thunderbird",
625+
"fields": {
626+
"server": "Server:",
627+
"userName": "User Name:",
628+
"password": "Password:",
629+
"yourAppPassword": "Your app password",
630+
"description": "Description:",
631+
"accountType": "Account Type:",
632+
"manual": "Manual",
633+
"serverAddress": "Server Address:",
634+
"url": "URL:",
635+
"user": "User:"
636+
},
637+
"steps": {
638+
"ios": {
639+
"1": "Open <strong>Settings</strong> and tap <strong>Contacts</strong>",
640+
"2": "Tap <strong>Accounts</strong>, then <strong>Add Account</strong>",
641+
"3": "Select <strong>Other</strong> at the bottom",
642+
"4": "Tap <strong>Add CardDAV Account</strong>",
643+
"5": "Enter your details:",
644+
"6": "Tap <strong>Next</strong> to verify and save"
645+
},
646+
"macos": {
647+
"1": "Open <strong>System Settings</strong> (or System Preferences)",
648+
"2": "Click <strong>Internet Accounts</strong>",
649+
"3": "Click <strong>Add Account</strong>, then select <strong>Other Contacts Account</strong>",
650+
"4": "Select <strong>CardDAV</strong> as the account type",
651+
"5": "Enter your details:",
652+
"6": "Click <strong>Sign In</strong>"
653+
},
654+
"thunderbird": {
655+
"1": "Install the <strong>CardBook</strong> add-on from Thunderbird Add-ons",
656+
"2": "Open <strong>CardBook</strong> from the Thunderbird menu",
657+
"3": "Click <strong>Address Book</strong> &rarr; <strong>New Address Book</strong>",
658+
"4": "Select <strong>Remote</strong> and click <strong>Next</strong>",
659+
"5": "Select <strong>CardDAV</strong> and click <strong>Next</strong>",
660+
"6": "Enter your details:",
661+
"7": "Click <strong>Validate</strong> to verify the connection",
662+
"8": "Select the address book and complete the setup"
663+
}
664+
}
625665
},
626666
"danger": {
627667
"title": "Danger Zone",

0 commit comments

Comments
 (0)