From b6c9b4ec30520df1fe32fbf63810f9a7310f6e31 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 31 Dec 2012 15:47:42 +0100 Subject: [PATCH] Fix #1309 : Fix support for node v0.6 --- src/node/hooks/i18n.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/hooks/i18n.js b/src/node/hooks/i18n.js index 2d10fd5b..62631b93 100644 --- a/src/node/hooks/i18n.js +++ b/src/node/hooks/i18n.js @@ -5,6 +5,8 @@ var languages = require('languages4translatewiki') , _ = require('underscore') , npm = require('npm') , plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins.js').plugins + , semver = require('semver') + , existsSync = semver.gt(process.version, '0.7.0') ? fs.existsSync : path.existsSync ; @@ -17,7 +19,7 @@ function getAllLocales() { // into `locales2paths` (files from various dirs are grouped by lang code) // (only json files with valid language code as name) function extractLangs(dir) { - if(!fs.existsSync(dir)) return; + if(!existsSync(dir)) return; var stat = fs.lstatSync(dir); if (!stat.isDirectory() || stat.isSymbolicLink()) return;