Skip to content

Commit 90aae3d

Browse files
committed
adjust tests and docs
1 parent 0ea2e78 commit 90aae3d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

library/src/storages/globalConfig/globalConfig.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff 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', () => {

website/src/routes/guides/(advanced)/internationalization/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ The language used is then selected by the `lang` configuration. You can set it g
4646

4747
```ts
4848
import * as v from 'valibot';
49+
import { getLocale } from "$lib/paraglide/runtime";
50+
4951

5052
// Set the language configuration globally
5153
v.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
5759
v.parse(Schema, input, { lang: 'de' });

0 commit comments

Comments
 (0)