lib/routes/index.js
function (request, response, next) {
    response.locals.i18n = {
      getLocale: function () {
        return request.cookies.appLanguage || vulpejs.i18n.getLocale.apply(request, arguments);
      },
    };

    // For backwards compatibility, also define 'acceptedLanguage'.
    response.locals.acceptedLanguage = response.locals.i18n.getLocale;

    if (typeof next !== 'undefined') {
      next();
    }
  }
function (request, response, next) {
    response.locals.i18n = {
      getLocale: function () {
        return request.cookies.appLanguage || vulpejs.i18n.getLocale.apply(request, arguments);
      },
    };

    // For backwards compatibility, also define 'acceptedLanguage'.
    response.locals.acceptedLanguage = response.locals.i18n.getLocale;

    if (typeof next !== 'undefined') {
      next();
    }
  }
function ( request , response , next ) { response . locals . i18n = { getLocale : function ( ) { return request . cookies . appLanguage || vulpejs . i18n . getLocale . apply ( request , arguments ) ; } , } ; // For backwards compatibility, also define 'acceptedLanguage'. response . locals . acceptedLanguage = response . locals . i18n . getLocale ; if ( typeof next !== 'undefined' ) { next ( ) ; } }
Middleware to allow retrieval of users locale in the template engine.
@param {Object} request
@param {Object} response
@param {Function} [next]
Middleware to allow retrieval of users locale in the template engine .