Skip to content

Faker set locale #3447

Answered by Julien-R44
clabnet asked this question in Help
Dec 27, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

You can do it like this :

export const AccountFactory = Factory.define(Account, ({ faker }) => {
  faker.setLocale('it')
  ...
  return {}
})

Looking at the lucid source code, there doesn't seem to be a way to globally define faker localization at the moment. That said, the feature could be added quite easily, if you have the time to do a PR !

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@clabnet
Comment options

Comment options

You must be logged in to vote
1 reply
@clabnet
Comment options

Answer selected by clabnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants