mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-23 14:17:05 +00:00
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:
parent
84e1223809
commit
11595caeb5
1 changed files with 1 additions and 0 deletions
|
|
@ -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)));
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue