back to globalize... don't work :S

pull/1223/head
Iván Eixarch 2012-11-28 04:02:55 +01:00
parent 1cc0e8cbf0
commit 9ec8a6e3d3
2 changed files with 8 additions and 5 deletions

View File

@ -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));

View File

@ -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": {