diff --git a/src/node/hooks/i18n.js b/src/node/hooks/i18n.js index 50946c42..4d42de04 100644 --- a/src/node/hooks/i18n.js +++ b/src/node/hooks/i18n.js @@ -1,4 +1,4 @@ -var Globalize = require('globalize') +var languages = require('languages') , fs = require('fs') , path = require('path') , express = require('express') @@ -8,7 +8,8 @@ var localesPath = __dirname+"/../../locales"; // Serve English strings directly with /locales.ini var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n'; -exports.availableLangs = {en: 'English'}; +// add language base 'en' to availableLangs +exports.availableLangs = {en: languages.getLanguageInfo('en')} fs.readdir(localesPath, function(er, files) { files.forEach(function(locale) { @@ -18,9 +19,8 @@ fs.readdir(localesPath, function(er, files) { // build locale index localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n' - require('globalize/lib/cultures/globalize.culture.'+locale+'.js') - var culture = Globalize.cultures[locale]; - exports.availableLangs[culture.name] = culture.nativeName; + // add info language {name, nativeName, direction} to availableLangs + exports.availableLangs[locale]=languages.getLanguageInfo(locale); }) }) @@ -32,4 +32,4 @@ exports.expressCreateServer = function(n, args) { res.send(localeIndex); }) -} \ No newline at end of file +} diff --git a/src/package.json b/src/package.json index bbad0e7a..9fd180ab 100644 --- a/src/package.json +++ b/src/package.json @@ -36,7 +36,7 @@ "tinycon" : "0.0.1", "underscore" : "1.3.1", "unorm" : "1.0.0", - "globalize" : "0.1.1" + "languages" : "0.1.1" }, "bin": { "etherpad-lite": "./node/server.js" }, "devDependencies": { diff --git a/src/templates/pad.html b/src/templates/pad.html index 82bd1070..3f3eee4f 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -227,7 +227,7 @@