middleware for locale