lykmapipo / sails-hook-validation

Custom validation error messages for sails model with i18n support
104 stars 29 forks source link

TypeError: request.getLocale is not a function #33

Closed vromanchakvakoms closed 7 years ago

vromanchakvakoms commented 8 years ago

Hi there When send request, got locale error, how to turn off force locale checking?

file index.js

routes: {
            before: {
                'all /*': function grabLocale(request, response, next) {
                    //configure i18n current request locale
                    sails.config.i18n.requestLocale = request.getLocale(); //<-- error here

                    //continue
                    next();
                }
            }
        }
nataliethistime commented 8 years ago

I'm getting this error because I have i18n disabled in my RESTful Sails API. Is there a solution to this?

KSDaemon commented 8 years ago

+1 for this. Sails-hook-validation doesn't work if i18n hook is turned off. Will be great to check i18n status and if it is off, then just return error messages from model description.

sercanov commented 7 years ago

+1