[READ-ONLY] Mirror of https://github.com/probablykasper/niceform. Convenient form validation and typing for SvelteKit
0

Configure Feed

Select the types of activity you want to include in your feed.

Add i18n example

authored by

Kasper and committed by
GitHub
(Feb 1, 2025, 9:03 AM +0100) c8c7ca87 cd93b414

+14 -1
+14 -1
README.md
··· 3 3 4 4 Might turn this into an actual package later 5 5 6 - ### Example `+page.server.ts`: 6 + ### Example `+page.server.ts` 7 7 ```ts 8 8 import { z } from 'zod' 9 9 import { nice_form } from '$lib/niceform' ··· 69 69 {/if} 70 70 </div> 71 71 ``` 72 + 73 + ### i18n example 74 + ```ts 75 + import { z } from 'zod' 76 + import * as m from '$lib/paraglide/messages' 77 + import { set_error_map } from './niceform' 78 + 79 + export const form_errors = set_error_map({ 80 + invalid_email: m.invalid_email, 81 + }) 82 + 83 + export const email_schema = z.string().email(form_errors.invalid_email).max(100) 84 + ```