In 1.8.0, the ability of specifiying the locale used in faker.js has been implemented, but doesn't apply automatically (and isn't documented).
I've haven't managed to make it work with the given example:
for (const fixture of fixturesIterator(fixtures)) {
const entity = await builder.build(fixture);
await getRepository(entity.constructor.name).save(entity);
}
with the given fixture:
entity: User
locale: fr
items:
user{1..10}:
firstName: '{{name.firstName}}'
lastName: '{{name.lastName}}'
birthDate: '{{date.past}}'
email: '{{internet.email}}'
phone: '{{phone.phoneNumber}}'
country: France
city: '{{address.city}}'
I've added the line fixture.locale = 'fr'; before builder.build line, and it works fine (so I've assumed locale parameter from yml file wasn't read properly).
This PR fixes the missing locale property of a IFixture, and add documentation in README.md to apply a locale for faker.js.
In 1.8.0, the ability of specifiying the locale used in faker.js has been implemented, but doesn't apply automatically (and isn't documented).
I've haven't managed to make it work with the given example:
with the given fixture:
I've added the line
fixture.locale = 'fr';
beforebuilder.build
line, and it works fine (so I've assumedlocale
parameter from yml file wasn't read properly).This PR fixes the missing
locale
property of aIFixture
, and add documentation in README.md to apply a locale for faker.js.