Only load .json files from locale directories

This opens up the possibility of putting READMEs or what have you
inside locale directories, and will avoid problems if system files or
folders end up in the locales.
This commit is contained in:
Greg Laabs 2014-05-26 08:18:48 -07:00
parent 84e1223809
commit 11595caeb5

View file

@ -11,6 +11,7 @@ var loadTranslations = function(locale){
var files = fs.readdirSync(path.join(localePath, locale));
translations[locale] = {};
_.each(files, function(file){
if(path.extname(file) !== '.json') return;
_.merge(translations[locale], require(path.join(localePath, locale, file)));
});
};