Open clsource opened 6 years ago
Middleware should be put in the service provider file
lang/providers.py
self.app.make(‘HttpMiddleware’).append(your middleware here)
The geoip language detection would be in a separate package if someone request it. Because it would add not critical additional files and weight to this package
These files will detect the language in each request.
Helpful links
Language Detection
Masonite must detect and set the locale automatically using three ways.
locale
.default
specified in the config.The translation functions will use the detected locale as the base for obtaining the translation strings.