feat(i18n): add language switcher
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
export const en = {
|
||||
common: {
|
||||
languageSwitcher: {
|
||||
label: "Language",
|
||||
options: {
|
||||
en: "English",
|
||||
es: "Spanish",
|
||||
},
|
||||
},
|
||||
},
|
||||
login: {
|
||||
title: "Sign In",
|
||||
usernameLabel: "Username",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user