File tree Expand file tree Collapse file tree
library/src/storages/globalConfig
website/src/routes/guides/(advanced)/internationalization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,11 +43,7 @@ describe('config', () => {
4343
4444 test ( 'should set and resolve lang function' , ( ) => {
4545 setGlobalConfig ( { lang : ( ) => 'fr' } ) ;
46- expect ( getGlobalConfig ( ) ) . toStrictEqual ( {
47- ...initialConfig ,
48- ...customConfig ,
49- lang : 'fr' ,
50- } ) ;
46+ expect ( getGlobalConfig ( ) . lang ) . toBe ( 'fr' ) ;
5147 } ) ;
5248
5349 test ( 'should call lang function each time' , ( ) => {
Original file line number Diff line number Diff line change @@ -46,12 +46,14 @@ The language used is then selected by the `lang` configuration. You can set it g
4646
4747``` ts
4848import * as v from ' valibot' ;
49+ import { getLocale } from " $lib/paraglide/runtime" ;
50+
4951
5052// Set the language configuration globally
5153v .setGlobalConfig ({ lang: ' de' });
5254
5355// Set the language dynamically using a callback
54- v .setGlobalConfig ({ lang : () => currentLanguage });
56+ v .setGlobalConfig ({ lang: getLocale });
5557
5658// Set the language configuration locally
5759v .parse (Schema , input , { lang: ' de' });
You can’t perform that action at this time.
0 commit comments