From 9ec8a6e3d38bde94a3bc52daa16bb1588157f67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Eixarch?= Date: Wed, 28 Nov 2012 04:02:55 +0100 Subject: [PATCH] back to globalize... don't work :S --- src/node/hooks/i18n.js | 11 +++++++---- src/package.json | 2 +- 2 files changed, 8 insertions(+), 5 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)); diff --git a/src/package.json b/src/package.json index 24bcdd84..2bc5ac22 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", - "languages4translatewiki" : "0.1.2" + "globalize" : "0.1.1" }, "bin": { "etherpad-lite": "./node/server.js" }, "devDependencies": {