11'use client' ;
22
3- < < << << < HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
4- << < < << < HEAD
5- < < < << < < HEAD
6- import { useParams } from 'next/navigation' ;
73import {
4+ Locale ,
85 PydanticForm ,
96 PydanticFormFieldFormat ,
107 PydanticFormFieldType ,
118} from 'pydantic-forms' ;
12- = === ===
13- >>> >>> > 6 b4540b ( Cleanup )
14- === = ===
15- import { useParams } from 'next/navigation' ;
16- > >>> >>> 305 eba5 ( prettier )
179import type {
18- = === ===
19- import {
20- Locale ,
21- > >>> >>> faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
2210 PydanticComponentMatcher ,
2311 PydanticFormApiProvider ,
2412 PydanticFormCustomDataProvider ,
2513 PydanticFormLabelProvider ,
2614} from 'pydantic-forms' ;
27- import {
28- PydanticForm ,
29- PydanticFormFieldFormat ,
30- PydanticFormFieldType ,
31- } from 'pydantic-forms' ;
32-
33- < < << << < HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
34- << < < << < HEAD
35- < < < << < < HEAD
36- import { TextArea } from '@/fields' ;
3715
38- import NLnl from '../../../messages/nl-NL.json' ;
39- = === ===
40- import { TextArea } from '@/fields' ;
41- import { useParams } from "next/navigation" ;
42- = === ===
43- import {
44- handleInvalidLocale ,
45- useGetTranslationMessages ,
46- } from '@/app/[locale]/useGetTranslationMessages' ;
47- = === ===
48- >>> >>> > faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
4916import { TextArea } from '@/fields' ;
50- > >>> >>> 305 eba5 ( prettier )
5117
52- << < < << < HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
53- > >>> >>> 6 b4540b ( Cleanup )
54- import styles from '../page.module.css' ;
55- = === ===
5618import styles from './page.module.css' ;
57- > >>> >>> faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
5819
59- << < < << < HEAD
60- export default function Home ( {
61- messages,
62- } : {
63- messages : Record < string , string > ;
64- } ) {
65- const params = useParams ( ) ;
66- const locale = params ?. locale as string ; // Get locale from URL params
67- = === ===
6820export default function Home ( ) {
69- < < << << < HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
70- const { locale } = useParams ( ) ;
71- const validLocale = handleInvalidLocale ( locale ) ;
72- > >>> >>> 6 b4540b ( Cleanup )
73-
74- === = ===
75- >>> > >>> faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
7621 const pydanticFormApiProvider : PydanticFormApiProvider = async ( {
7722 requestBody,
7823 } ) => {
@@ -109,17 +54,6 @@ export default function Home() {
10954 } ) ;
11055 } ;
11156
112- < < << << < HEAD
113- = === ===
114- const ResetButtonAlternative = ( ) => (
115- < button type = "button" > Alternative reset</ button >
116- ) ;
117-
118- const CancelButtonAlternative = ( ) => (
119- < button type = "button" > Alternative cancel</ button >
120- ) ;
121-
122- > >>> >>> 305 eba5 ( prettier )
12357 const componentMatcher = (
12458 currentMatchers : PydanticComponentMatcher [ ] ,
12559 ) : PydanticComponentMatcher [ ] => {
@@ -141,23 +75,13 @@ export default function Home() {
14175 ] ;
14276 } ;
14377
144- < < << << < HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
145- << < < << < HEAD
146- // const translations = getMessages(locale);
147- // console.log('NEW translations', translations);
148-
149- = === ===
150- >>> >>> > 6b4540b (Cleanup)
151- =======
15278 const customTranslations = {
15379 renderForm : {
15480 loading : 'The form is loading. Please wait.' ,
15581 } ,
15682 } ;
157-
15883 const locale = Locale . enGB ;
15984
160- >>> >>> > faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
16185 return (
16286 < div className = { styles . page } >
16387 < h1 style = { { marginBottom : '20px' } } > Pydantic Form </ h1 >
@@ -175,26 +99,8 @@ export default function Home() {
17599 labelProvider : pydanticLabelProvider ,
176100 customDataProvider : pydanticCustomDataProvider ,
177101 componentMatcher : componentMatcher ,
178- < << << << HEAD :frontend / apps / example / src / app / [ locale ] / page . tsx
179- << < < << < HEAD
180- < < < << < < HEAD
181- < < < << < < HEAD
182- translations : NLnl ,
183- === = ===
184- translations : useGetTranslationMessages ( validLocale )
185- >>> > >>> 6 b4540b ( Cleanup )
186- === = ===
187- translations : useGetTranslationMessages ( validLocale ) , //Comment this line for default translations
188- locale : validLocale
189- >>> > >>> 07848e9 ( Some refactor )
190- === = ===
191- translations : useGetTranslationMessages ( validLocale ) , //Comment this line for default translations
192- locale : validLocale ,
193- > >>> >>> 305 eba5 ( prettier )
194- = === ===
195102 customTranslations : customTranslations ,
196103 locale : locale ,
197- > >>> >>> faa8b5a ( Resolved comments ) :frontend / apps / example / src / app / page . tsx
198104 } }
199105 />
200106 </ div >
0 commit comments