# Setting-up faker locale?

**URL:** <https://community.postman.com/t/setting-up-faker-locale/26078>\
**Category:** Help Hub\
**Created:** [July 22, 2021, 5:54pm UTC](https://community.postman.com/t/setting-up-faker-locale/26078 "2021-07-22T17:54:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PsNizza](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@PsNizza](https://community.postman.com/u/PsNizza)\
**Post date:** [July 22, 2021, 5:54pm UTC](https://community.postman.com/t/setting-up-faker-locale/26078/1 "2021-07-22T17:54:02Z")

</div>

Hi everyone,

I’m looking for a way to set the faker locale used for dynamic variables (e.g. {{$randomLastName}}), in order to retreive data localized.  
I guess by default Postam (v8.8.0) is using “en”.

Many thanks,

---

<div class="post-metadata">

**Author:** ![neilstudd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/neilstudd/32/8213_2.png) [@neilstudd](https://community.postman.com/u/neilstudd)\
**Post date:** [July 22, 2021, 7:35pm UTC](https://community.postman.com/t/setting-up-faker-locale/26078/2 "2021-07-22T19:35:32Z")

</div>

Hi @PsNizza,

Although you can’t override the locale in Postman’s built-in version of Faker, it’s possible to manually re-inject Faker via script, and specify the locale you wish to use. Try the solution from the post below, and see if this helps you:

> [@How we can use faker in Postman v 7.2](https://community.postman.com/t/how-we-can-use-faker-in-postman-v-7-2/5916/9):
>
> Hello there Christian, This is what worked for me to get the faker locale working in the test script: window = {}; pm.sendRequest("https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js", (error, response) =\> { var text = response.text(); (new Function(text))(); window.faker.locale = "de"; var name = window.faker.name.findName(); console.log(name); pm.globals.set("name", name); })

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [July 23, 2021, 12:39am UTC](https://community.postman.com/t/setting-up-faker-locale/26078/3 "2021-07-23T00:39:14Z")

</div>

@PsNizza Welcome to the Community 🥳

Just adding to @neilstudd said 😊

@sean.keegan made a [collection](https://www.postman.com/devrel/workspace/fakerjs-example/request/14272639-7a804fd0-beeb-4d5b-a024-dd0b623850e3) here to show case an example using french locale, you can also see this.

I hope this helps 🚀 All the best!! Let us know if you are able to get the dynamic values for your locale 😇

---

<div class="post-metadata">

**Author:** ![PsNizza](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@PsNizza](https://community.postman.com/u/PsNizza)\
**Post date:** [July 23, 2021, 8:46am UTC](https://community.postman.com/t/setting-up-faker-locale/26078/4 "2021-07-23T08:46:27Z")

</div>

Hi @neilstudd , @bpricilla

Thanks a lot for your answers, working fine !! (I had seen the post from Dblom, but better with real example 😉)

Hope one day it will be integrated in Postman (set-up of faker locale), as it is really useful to work with localized data to test local APIs

Best,

---

<div class="post-metadata">

**Author:** ![sean.keegan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sean.keegan/32/6353_2.png) [@sean.keegan](https://community.postman.com/u/sean.keegan)\
**Post date:** [July 23, 2021, 6:24pm UTC](https://community.postman.com/t/setting-up-faker-locale/26078/5 "2021-07-23T18:24:21Z")

</div>

Hey @PsNizza! Glad you’re able to get it working! I hope my collection helped somewhat 🙂

A few other folks have requested some things related to the Fakerjs library on our GitHub issues (here’s [one](https://github.com/postmanlabs/postman-app-support/issues/9625) in particular). Feel free to join the convo there as well and upvote or create a new issue so our team knows people are asking for it.
