NinjasCL-archive / masonite-i18n

i18n for Masonite Framework
MIT License
2 stars 2 forks source link

Implement Middleware files #3

Open clsource opened 6 years ago

clsource commented 6 years ago

These files will detect the language in each request.

Helpful links

Language Detection

Masonite must detect and set the locale automatically using three ways.

The translation functions will use the detected locale as the base for obtaining the translation strings.

clsource commented 6 years ago

Middleware should be put in the service provider file

lang/providers.py

self.app.make(‘HttpMiddleware’).append(your middleware here)

clsource commented 6 years ago

TODO

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

clsource commented 6 years ago

https://github.com/MasoniteFramework/core/pull/308