back to globalize... don't work :S
This commit is contained in:
parent
1cc0e8cbf0
commit
9ec8a6e3d3
|
@ -1,4 +1,4 @@
|
||||||
var languages = require('languages4translatewiki')
|
var Globalize = require('globalize')
|
||||||
, fs = require('fs')
|
, fs = require('fs')
|
||||||
, path = require('path')
|
, path = require('path')
|
||||||
, express = require('express')
|
, express = require('express')
|
||||||
|
@ -9,7 +9,8 @@ var localesPath = __dirname+"/../../locales";
|
||||||
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
|
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
|
||||||
|
|
||||||
// add language base 'en' to availableLangs
|
// 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) {
|
fs.readdir(localesPath, function(er, files) {
|
||||||
files.forEach(function(locale) {
|
files.forEach(function(locale) {
|
||||||
|
@ -19,11 +20,13 @@ fs.readdir(localesPath, function(er, files) {
|
||||||
// build locale index
|
// build locale index
|
||||||
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
|
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
|
||||||
|
|
||||||
// add info language {name, nativeName, direction} to availableLangs
|
require('globalize/lib/cultures/globalize.culture.'+locale+'.js')
|
||||||
exports.availableLangs[locale]=languages.getLanguageInfo(locale);
|
exports.availableLangs[locale]=Globalize.cultures[locale];
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(exports.availableLangs);
|
||||||
|
|
||||||
exports.expressCreateServer = function(n, args) {
|
exports.expressCreateServer = function(n, args) {
|
||||||
|
|
||||||
args.app.use('/locales', express.static(localesPath));
|
args.app.use('/locales', express.static(localesPath));
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
"tinycon" : "0.0.1",
|
"tinycon" : "0.0.1",
|
||||||
"underscore" : "1.3.1",
|
"underscore" : "1.3.1",
|
||||||
"unorm" : "1.0.0",
|
"unorm" : "1.0.0",
|
||||||
"languages4translatewiki" : "0.1.2"
|
"globalize" : "0.1.1"
|
||||||
},
|
},
|
||||||
"bin": { "etherpad-lite": "./node/server.js" },
|
"bin": { "etherpad-lite": "./node/server.js" },
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
Loading…
Reference in New Issue