Merge pull request #2886 from bhldev/padOptionsLang
Set language cookie on initial load Issue #2882
This commit is contained in:
commit
d994baeefa
|
@ -2,6 +2,7 @@ var path = require('path');
|
||||||
var eejs = require('ep_etherpad-lite/node/eejs');
|
var eejs = require('ep_etherpad-lite/node/eejs');
|
||||||
var toolbar = require("ep_etherpad-lite/node/utils/toolbar");
|
var toolbar = require("ep_etherpad-lite/node/utils/toolbar");
|
||||||
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||||
|
var settings = require('../../utils/Settings');
|
||||||
|
|
||||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
// expose current stats
|
// expose current stats
|
||||||
|
@ -33,6 +34,13 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
//serve pad.html under /p
|
//serve pad.html under /p
|
||||||
args.app.get('/p/:pad', function(req, res, next)
|
args.app.get('/p/:pad', function(req, res, next)
|
||||||
{
|
{
|
||||||
|
// Set language for pad editor for the first time
|
||||||
|
// Or if language cookie doesn't exist
|
||||||
|
if (req.cookies.language === undefined)
|
||||||
|
{
|
||||||
|
res.cookie('language', settings.padOptions.lang);
|
||||||
|
}
|
||||||
|
|
||||||
// The below might break for pads being rewritten
|
// The below might break for pads being rewritten
|
||||||
var isReadOnly = req.url.indexOf("/p/r.") === 0;
|
var isReadOnly = req.url.indexOf("/p/r.") === 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue