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:
@@ -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)));
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user