Merge pull request #1223 from joker-x/languages4translatewiki
Added support for *all* translatewiki languagespull/1257/head
commit
ce71002644
|
@ -1,4 +1,4 @@
|
|||
var languages = require('languages')
|
||||
var languages = require('languages4translatewiki')
|
||||
, fs = require('fs')
|
||||
, path = require('path')
|
||||
, express = require('express')
|
||||
|
@ -8,22 +8,23 @@ var localesPath = __dirname+"/../../locales";
|
|||
// Serve English strings directly with /locales.ini
|
||||
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
|
||||
|
||||
// add language base 'en' to availableLangs
|
||||
exports.availableLangs = {en: languages.getLanguageInfo('en')}
|
||||
exports.availableLangs = {'en': {'nativeName': 'English', 'direction': 'ltr'}};
|
||||
|
||||
fs.readdir(localesPath, function(er, files) {
|
||||
files.forEach(function(locale) {
|
||||
locale = locale.split('.')[0]
|
||||
if(locale.toLowerCase() == 'en') return;
|
||||
var ext = path.extname(locale);
|
||||
locale = path.basename(locale, ext).toLowerCase();
|
||||
if(locale == 'en' || ext != '.ini') return;
|
||||
|
||||
// build locale index
|
||||
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
|
||||
|
||||
// add info language {name, nativeName, direction} to availableLangs
|
||||
// add info language {nativeName, direction} to availableLangs
|
||||
exports.availableLangs[locale]=languages.getLanguageInfo(locale);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
exports.expressCreateServer = function(n, args) {
|
||||
|
||||
args.app.use('/locales', express.static(localesPath));
|
||||
|
|
|
@ -11,32 +11,32 @@
|
|||
{ "name": "Marcel Klehr" }
|
||||
],
|
||||
"dependencies" : {
|
||||
"yajsml" : "1.1.6",
|
||||
"request" : "2.9.100",
|
||||
"require-kernel" : "1.0.5",
|
||||
"resolve" : "0.2.x",
|
||||
"socket.io" : "0.9.x",
|
||||
"ueberDB" : "0.1.8",
|
||||
"async" : "0.1.x",
|
||||
"express" : "3.x",
|
||||
"connect" : "2.4.x",
|
||||
"clean-css" : "0.3.2",
|
||||
"uglify-js" : "1.2.5",
|
||||
"formidable" : "1.0.9",
|
||||
"log4js" : "0.5.x",
|
||||
"jsdom-nocontextifiy" : "0.2.10",
|
||||
"async-stacktrace" : "0.0.2",
|
||||
"npm" : "1.1.x",
|
||||
"npm-registry-client" : "0.2.10",
|
||||
"ejs" : "0.6.1",
|
||||
"graceful-fs" : "1.1.5",
|
||||
"slide" : "1.1.3",
|
||||
"semver" : "1.0.13",
|
||||
"security" : "1.0.0",
|
||||
"tinycon" : "0.0.1",
|
||||
"underscore" : "1.3.1",
|
||||
"unorm" : "1.0.0",
|
||||
"languages" : "0.1.1"
|
||||
"yajsml" : "1.1.6",
|
||||
"request" : "2.9.100",
|
||||
"require-kernel" : "1.0.5",
|
||||
"resolve" : "0.2.x",
|
||||
"socket.io" : "0.9.x",
|
||||
"ueberDB" : "0.1.8",
|
||||
"async" : "0.1.x",
|
||||
"express" : "3.x",
|
||||
"connect" : "2.4.x",
|
||||
"clean-css" : "0.3.2",
|
||||
"uglify-js" : "1.2.5",
|
||||
"formidable" : "1.0.9",
|
||||
"log4js" : "0.5.x",
|
||||
"jsdom-nocontextifiy" : "0.2.10",
|
||||
"async-stacktrace" : "0.0.2",
|
||||
"npm" : "1.1.x",
|
||||
"npm-registry-client" : "0.2.10",
|
||||
"ejs" : "0.6.1",
|
||||
"graceful-fs" : "1.1.5",
|
||||
"slide" : "1.1.3",
|
||||
"semver" : "1.0.13",
|
||||
"security" : "1.0.0",
|
||||
"tinycon" : "0.0.1",
|
||||
"underscore" : "1.3.1",
|
||||
"unorm" : "1.0.0",
|
||||
"languages4translatewiki" : "0.1.3"
|
||||
},
|
||||
"bin": { "etherpad-lite": "./node/server.js" },
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in New Issue