mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-31 11:46:37 +00:00
refactor: upgrade to Zod v4 (#623)
This commit is contained in:
10
frontend/src/lib/utils/locale.util.ts
Normal file
10
frontend/src/lib/utils/locale.util.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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 });
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user