mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-28 18:26:36 +00:00
11 lines
369 B
TypeScript
11 lines
369 B
TypeScript
import { setLocale as setParaglideLocale, type Locale } from '$lib/paraglide/runtime';
|
|
import { z } from 'zod/v4';
|
|
|
|
export function setLocale(locale: Locale, reload = true) {
|
|
import(`../../../node_modules/zod/dist/esm/v4/locales/${locale}.js`)
|
|
.then((zodLocale) => z.config(zodLocale.default()))
|
|
.finally(() => {
|
|
setParaglideLocale(locale, { reload });
|
|
});
|
|
}
|