Hacky solution for exploreDir error

We should only traverse the directories of actual plugins instead
of traversing the whole node_modules folder
pull/1297/head
Marcel Klehr 2012-12-19 16:31:17 +01:00
parent f4f2c1d9ab
commit e3f9ed37b4
1 changed files with 7 additions and 6 deletions

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;
}