Skip to content

Commit

Permalink
[api] Require all locales by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Sep 15, 2014
1 parent 2e08141 commit c2975a9
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions lib/locales.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
if (typeof window === "undefined") {
// if node, load all locales into memory by default
var fs = require('fs'),
files = fs.readdirSync(__dirname + '/locales/');

files.forEach(function(item){
exports[item.replace('.js', '')] = require(__dirname + '/locales/' + item);
});
} else {
// if browser, only load en locale
// TODO: setup Gulp build step to generate multiple browser packages
exports['en'] = require('./locales/en.js');
}
var faker = require('../index');
exports['de'] = require('./locales/de.js');
exports['de_AT'] = require('./locales/de_AT.js');
exports['de_CH'] = require('./locales/de_CH.js');
exports['en'] = require('./locales/en.js');
exports['en_AU'] = require('./locales/en_AU.js');
exports['en_BORK'] = require('./locales/en_BORK.js');
exports['en_CA'] = require('./locales/en_CA.js');
exports['en_GB'] = require('./locales/en_GB.js');
exports['en_IND'] = require('./locales/en_IND.js');
exports['en_US'] = require('./locales/en_US.js');
exports['en_au_ocker'] = require('./locales/en_au_ocker.js');
exports['es'] = require('./locales/es.js');
exports['fa'] = require('./locales/fa.js');
exports['fr'] = require('./locales/fr.js');
exports['it'] = require('./locales/it.js');
exports['ja'] = require('./locales/ja.js');
exports['ko'] = require('./locales/ko.js');
exports['nb_NO'] = require('./locales/nb_NO.js');
exports['nep'] = require('./locales/nep.js');
exports['nl'] = require('./locales/nl.js');
exports['pl'] = require('./locales/pl.js');
exports['pt_BR'] = require('./locales/pt_BR.js');
exports['ru'] = require('./locales/ru.js');
exports['sk'] = require('./locales/sk.js');
exports['sv'] = require('./locales/sv.js');
exports['vi'] = require('./locales/vi.js');
exports['zh_CN'] = require('./locales/zh_CN.js');

0 comments on commit c2975a9

Please sign in to comment.