From 9bb2b7c341bcf41e00341c92a8a66620c401c85f Mon Sep 17 00:00:00 2001 From: Marak Date: Mon, 15 Feb 2016 07:19:17 -0500 Subject: [api] Added `random.locale` method. Closes #274 * Returns a random locale * May not work correctly in locale builds --- lib/random.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/random.js b/lib/random.js index 70bc9f9a..138d4bdc 100644 --- a/lib/random.js +++ b/lib/random.js @@ -133,6 +133,10 @@ function Random (faker, seed) { return faker.image.image(); } + this.locale = function randomLocale () { + return faker.random.arrayElement(Object.keys(faker.locales)); + }; + return this; } -- cgit v1.2.3