initial commit

This commit is contained in:
2026-09-11 02:46:56 +02:00
commit 20b384039c
288 changed files with 46557 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
/* ============================================================================
ROUTE LOCALE
----------------------------------------------------------------------------
`:lang` is already validated by the locale layout - an unknown segment 404s
before a page loader ever runs - so this only narrows `string` to `Locale`
for the type system, with the default locale as an unreachable fallback.
========================================================================= */
import { DEFAULT_LOCALE, isLocale, type Locale } from "~/i18n";
export function routeLocale(params: { readonly lang?: string }): Locale {
return isLocale(params.lang) ? params.lang : DEFAULT_LOCALE;
}