summaryrefslogtreecommitdiff
path: root/src/node/hooks
diff options
context:
space:
mode:
authorIván Eixarch <miao.org@gmail.com>2012-11-20 19:46:17 +0100
committerIván Eixarch <miao.org@gmail.com>2012-11-20 19:46:17 +0100
commit1e71797ad527d6658d1e2b52e9af207e51d281dd (patch)
tree4ebff7005253319de5a4bc9912193877a51ff06d /src/node/hooks
parentb51515604155a05edcc2273763210cf5f1ddb653 (diff)
downloadetherpad-lite-1e71797ad527d6658d1e2b52e9af207e51d281dd.zip
Replace Globalize with languages module
Diffstat (limited to 'src/node/hooks')
-rw-r--r--src/node/hooks/i18n.js12
1 files changed, 6 insertions, 6 deletions
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
+}