From ad8e76202f93d1bdcc33ee2641ec773082257b75 Mon Sep 17 00:00:00 2001 From: Jeremie Zitti Date: Wed, 22 Jul 2026 13:47:16 +0100 Subject: [PATCH] fix(i18n): default language is English --- frontend/src/lib/i18n/en.ts | 2 ++ frontend/src/lib/i18n/fr.ts | 2 +- frontend/src/lib/i18n/index.svelte.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/i18n/en.ts b/frontend/src/lib/i18n/en.ts index ef34622..6a435c0 100644 --- a/frontend/src/lib/i18n/en.ts +++ b/frontend/src/lib/i18n/en.ts @@ -1,3 +1,5 @@ +// The lang_switch value shows the label of the OTHER language (so when EN is +// active the button offers to switch to FR). export default { title: 'Skilluv starter — fullstack Rust', tagline: 'Rust + Axum backend, SvelteKit frontend, PostgreSQL, ready to hack.', diff --git a/frontend/src/lib/i18n/fr.ts b/frontend/src/lib/i18n/fr.ts index cbfe134..6f50318 100644 --- a/frontend/src/lib/i18n/fr.ts +++ b/frontend/src/lib/i18n/fr.ts @@ -7,5 +7,5 @@ export default { notes_placeholder: 'Écris une note…', notes_add: 'Ajouter', notes_empty: 'Aucune note pour le moment.', - lang_switch: 'EN' + lang_switch: 'EN' // shows label of OTHER lang } as const; diff --git a/frontend/src/lib/i18n/index.svelte.ts b/frontend/src/lib/i18n/index.svelte.ts index f84220d..ee9d25e 100644 --- a/frontend/src/lib/i18n/index.svelte.ts +++ b/frontend/src/lib/i18n/index.svelte.ts @@ -6,9 +6,9 @@ export const dictionaries = { en, fr } as const; export type Dict = typeof en; class LangState { - current = $state('fr'); + current = $state('en'); toggle() { - this.current = this.current === 'fr' ? 'en' : 'fr'; + this.current = this.current === 'en' ? 'fr' : 'en'; } get t(): Dict { return dictionaries[this.current];