feat(i18n): add language switcher

This commit is contained in:
2026-06-11 16:16:06 +02:00
parent 18a192a069
commit c3cf4182ad
11 changed files with 319 additions and 2 deletions
+9
View File
@@ -1,4 +1,13 @@
export const en = {
common: {
languageSwitcher: {
label: "Language",
options: {
en: "English",
es: "Spanish",
},
},
},
login: {
title: "Sign In",
usernameLabel: "Username",
+9
View File
@@ -1,6 +1,15 @@
import type { Dictionary } from "./en"
export const es = {
common: {
languageSwitcher: {
label: "Idioma",
options: {
en: "Inglés",
es: "Español",
},
},
},
login: {
title: "Iniciar sesión",
usernameLabel: "Usuario",
+1
View File
@@ -5,6 +5,7 @@ export type Locale = (typeof SUPPORTED_LOCALES)[number]
export const FALLBACK_LOCALE: Locale = "en"
export const DEFAULT_LOCALE_ENV_VAR = "STOCK_MANAGER_DEFAULT_LOCALE"
export const LOCALE_COOKIE_NAME = "stock-manager-locale"
export const LOCALE_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365
export function isLocale(value: unknown): value is Locale {
return (