I'm building a website in Laravel, I'm having it get the browser language and set the website's language accordingly.
Problem is, nothing in Registrar.php seems to get translated in English or Dutch
Could anyone please help me out? Thanks, g3
I'm building a website in Laravel, I'm having it get the browser language and set the website's language accordingly.
Problem is, nothing in Registrar.php seems to get translated in English or Dutch
Could anyone please help me out? Thanks, g3
To make this work you need to use a middleware to set Locales:
Create a
LocaleMiddleware.php
insideapp/http/middleware
directoryThen register the middleware in
app\httpe.kernel.php
in$middleware
arrayCreating lang files
You need to create separate folders for all languages you want to support and translate the files in them accordingly e.g
nl-be\validation.php
.You can start by coping the contents of
resources/lang/en to resources/lang/nl-be, then translate the contents of
nl-be\validation.php` to dutch equivalent