Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): fix faker v7 code example for locale migration #2125

Merged
merged 4 commits into from May 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/guide/upgrading.md
Expand Up @@ -30,7 +30,7 @@ import { faker } from '@faker-js/faker';
faker.setLocale('de_CH');
// or
faker.locale = 'de_CH';
faker.fallbackLocale = 'en';
faker.localeFallback = 'en';
```

**New**
Expand All @@ -44,11 +44,11 @@ This also fixes issues where more than two locales are required:
**Old**

```ts
import { faker } from '@faker-js/faker';

import { faker, Faker } from '@faker-js/faker';
const { de_CH, de, en } = faker.locales;
matthewmayer marked this conversation as resolved.
Show resolved Hide resolved
const customFaker = new Faker({
locale: 'de_CH', // the expected locale
fallbackLocale: 'de', // ensure we have a German fallbacks for addresses
localeFallback: 'de', // ensure we have a German fallbacks for addresses
locales: { de_CH, de, en },
});
const a = customFaker.internet.email();
Expand Down