-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
Using sails.config.i18n.requestLocale = request.getLocale(); is a bad idea!
It assumes that all the requests are processed serially and so, parallel requests will fail to get the correct locale!
https://github.com/lykmapipo/sails-hook-validation/blob/master/index.js#L73
return {
//intercent all request and current grab request locale
routes: {
before: {
'all /*': function grabLocale(request, response, next) {
//configure i18n current request locale
sails.config.i18n.requestLocale = request.getLocale();
//continue
next();
}
}
},
...