From dfcc3a784b5edeca1b9140c8830590e3fca883de Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 8 Mar 2017 12:50:20 +0200 Subject: Add 'setLocale' method to solve problem with ES6 import --- Readme.md | 2 ++ lib/index.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Readme.md b/Readme.md index fc23abe5..fc62d31e 100644 --- a/Readme.md +++ b/Readme.md @@ -238,6 +238,8 @@ Setting a new locale is simple: ```js // sets locale to de +faker.setLocale("de"); +// or faker.locale = "de"; ``` diff --git a/lib/index.js b/lib/index.js index 17f93bfc..45d8dcb3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -142,6 +142,10 @@ function Faker (opts) { }; +Faker.prototype.setLocale = function (locale) { + this.locale = locale; +} + Faker.prototype.seed = function(value) { var Random = require('./random'); this.seedValue = value; -- cgit v1.2.3