mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Replace Globalize with languages module
This commit is contained in:
parent
b515156041
commit
1e71797ad5
3 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue