diff options
| author | Matt Mayer <[email protected]> | 2023-04-25 22:05:52 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-25 17:05:52 +0200 |
| commit | 698fd7d909740bb9a9b7e9dfe822ef8632e3d4c6 (patch) | |
| tree | 015af666199b7ff20ac700586da7b8c47e707af5 /docs/guide/upgrading.md | |
| parent | 76c3080b758c3ced51d55e891396875a5004f5a8 (diff) | |
| download | faker-698fd7d909740bb9a9b7e9dfe822ef8632e3d4c6.tar.xz faker-698fd7d909740bb9a9b7e9dfe822ef8632e3d4c6.zip | |
feat(locale): add en_HK locale (#2083)
Diffstat (limited to 'docs/guide/upgrading.md')
| -rw-r--r-- | docs/guide/upgrading.md | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md index 0572f5f1..a4bf7da1 100644 --- a/docs/guide/upgrading.md +++ b/docs/guide/upgrading.md @@ -123,20 +123,12 @@ fakerES.music.songName(); // 'I Want to Hold Your Hand' (fallback from en) fakerES_noFallbacks.music.songName(); // throws a FakerError ``` -This also has an impact on data that aren't applicable to a locale, for example Chinese doesn't use prefixes in names. +This also has an impact on data that aren't applicable to a locale, for example Hong Kong (`en_HK`) doesn't use ZIP codes/postcodes. ```ts -import { faker, fakerZH_CN, zh_CN } from '@faker-js/faker'; - -const fakerZH_CN_noFallbacks = new Faker({ - locale: [zh_CN], -}); - -faker.name.prefix(); // 'Mr' -// Previously: -//fakerZH_CN_noFallbacks.person.prefix(); // undefined -// Now: -fakerZH_CN.person.prefix(); // throws a FakerError +import { fakerEN_US, fakerEN_HK } from '@faker-js/faker'; +fakerEN_US.location.zipCode(); // 90210 +fakerEN_HK.location.zipCode(); // throws a FakerError ``` ### `faker.mersenne` and `faker.helpers.repeatString` removed |
