Hacky solution for exploreDir error

We should only traverse the directories of actual plugins instead
of traversing the whole node_modules folder
This commit is contained in:
Marcel Klehr 2012-12-19 16:31:17 +01:00
parent f4f2c1d9ab
commit e3f9ed37b4

View file

@ -2,7 +2,9 @@ var languages = require('languages4translatewiki')
, fs = require('fs')
, path = require('path')
, express = require('express')
, _ = require('underscore');
, _ = require('underscore')
, npm = require('npm')
;
/*
* PRIVATE
@ -53,11 +55,10 @@ var getAllLocalesPaths = function () {
}
//add core supported languages first
var root = path.resolve(__dirname+"/../../locales");
exploreDir (root, extractLangs);
//add plugins languages (if any)
root = path.resolve(__dirname+"/../../../node_modules");
exploreDir (root, extractLangs);
exploreDir (npm.root+"/ep_etherpad-lite/locales", extractLangs);
//add plugins languages (if any) -- bad practice
exploreDir (npm.root, extractLangs);
return result;
}