summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorIván Eixarch <miao.org@gmail.com>2012-11-28 04:02:55 +0100
committerIván Eixarch <miao.org@gmail.com>2012-11-28 04:02:55 +0100
commit9ec8a6e3d38bde94a3bc52daa16bb1588157f67c (patch)
tree72096031740ab8cdd35715043d2c1f2c7a4a1ef4 /src/node
parent1cc0e8cbf0d38b4a34674623e329cf9e2379c209 (diff)
downloadetherpad-lite-9ec8a6e3d38bde94a3bc52daa16bb1588157f67c.zip
back to globalize... don't work :S
Diffstat (limited to 'src/node')
-rw-r--r--src/node/hooks/i18n.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/node/hooks/i18n.js b/src/node/hooks/i18n.js
index f6f0f8c8..147ef533 100644
--- a/src/node/hooks/i18n.js
+++ b/src/node/hooks/i18n.js
@@ -1,4 +1,4 @@
-var languages = require('languages4translatewiki')
+var Globalize = require('globalize')
, fs = require('fs')
, path = require('path')
, express = require('express')
@@ -9,7 +9,8 @@ var localesPath = __dirname+"/../../locales";
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
// add language base 'en' to availableLangs
-exports.availableLangs = {en: {name:'English',nativeName:'English',direction:'ltr'}};
+exports.availableLangs = {};
+exports.availableLangs['en'] = Globalize.cultures['en'];
fs.readdir(localesPath, function(er, files) {
files.forEach(function(locale) {
@@ -19,11 +20,13 @@ fs.readdir(localesPath, function(er, files) {
// build locale index
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
- // add info language {name, nativeName, direction} to availableLangs
- exports.availableLangs[locale]=languages.getLanguageInfo(locale);
+ require('globalize/lib/cultures/globalize.culture.'+locale+'.js')
+ exports.availableLangs[locale]=Globalize.cultures[locale];
})
})
+console.log(exports.availableLangs);
+
exports.expressCreateServer = function(n, args) {
args.app.use('/locales', express.static(localesPath));