diff --git a/apps/clock/apps/web/src/lib/i18n/index.ts b/apps/clock/apps/web/src/lib/i18n/index.ts
index 39a3dd004..4b36605dc 100644
--- a/apps/clock/apps/web/src/lib/i18n/index.ts
+++ b/apps/clock/apps/web/src/lib/i18n/index.ts
@@ -40,7 +40,7 @@ function getInitialLocale(): SupportedLocale {
return 'de';
}
-// Initialize
+// Initialize i18n at module scope (required for SSR)
init({
fallbackLocale: 'de',
initialLocale: getInitialLocale(),
@@ -53,3 +53,6 @@ export function setLocale(newLocale: SupportedLocale) {
localStorage.setItem('clock-locale', newLocale);
}
}
+
+// Wait for locale to be loaded (useful for SSR)
+export { waitLocale } from 'svelte-i18n';
diff --git a/apps/clock/apps/web/src/routes/+layout.svelte b/apps/clock/apps/web/src/routes/+layout.svelte
index cb3c6f5d5..8fee02a2d 100644
--- a/apps/clock/apps/web/src/routes/+layout.svelte
+++ b/apps/clock/apps/web/src/routes/+layout.svelte
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { onMount } from 'svelte';
- import { locale } from 'svelte-i18n';
+ import { locale, isLoading as isLocaleLoading } from 'svelte-i18n';
import { PillNavigation } from '@manacore/shared-ui';
import type { PillNavItem, PillDropdownItem } from '@manacore/shared-ui';
import { theme } from '$lib/stores/theme.svelte';
@@ -14,7 +14,7 @@
} from '$lib/stores/navigation';
import { getLanguageDropdownItems, getCurrentLanguageLabel } from '@manacore/shared-i18n';
import { getPillAppItems } from '@manacore/shared-branding';
- import { setLocale, supportedLocales } from '$lib/i18n';
+ import { setLocale, supportedLocales, waitLocale } from '$lib/i18n';
import ToastContainer from '$lib/components/ToastContainer.svelte';
import '../app.css';
@@ -77,8 +77,8 @@
const navItems: PillNavItem[] = [
{ href: '/', label: 'Übersicht', icon: 'home' },
{ href: '/alarms', label: 'Wecker', icon: 'bell' },
- { href: '/timers', label: 'Timer', icon: 'clock' },
- { href: '/stopwatch', label: 'Stoppuhr', icon: 'activity' },
+ { href: '/timers', label: 'Timer', icon: 'timer' },
+ { href: '/stopwatch', label: 'Stoppuhr', icon: 'stopwatch' },
{ href: '/pomodoro', label: 'Pomodoro', icon: 'target' },
{ href: '/world-clock', label: 'Weltzeituhr', icon: 'globe' },
{ href: '/settings', label: 'Einstellungen', icon: 'settings' },
@@ -137,6 +137,9 @@
}
onMount(async () => {
+ // Wait for locale to be loaded
+ await waitLocale();
+
// Initialize theme
theme.initialize();
@@ -165,10 +168,21 @@
Laden...
+