From 11595caeb5f8ea22b59153ae8b5bd238a47e33d5 Mon Sep 17 00:00:00 2001 From: Greg Laabs Date: Mon, 26 May 2014 08:18:48 -0700 Subject: [PATCH] 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. --- src/i18n.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n.js b/src/i18n.js index 43cddf6f32..238df963df 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -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))); }); };