Localization set a locale

Published 1 year ago by janakaontomatrix

When we set a locale we use App::setLocale($locale). Is this a global setting or do we have to set this every time a page loads. The documentation does not have anything on this. Help is appreciated. Thank you.

Lars-Janssen

You should set this in the boot method of you AppServiceProvider.php. (if that's what you mean)

janakaontomatrix

@lars6 Thank you I'll look into it.

bestmomo
bestmomo
1 year ago (356,570 XP)

The locale setted with setLocale is only for the current request as any config parameter.

papa
papa
1 year ago (8,285 XP)

@janakaontomatrix you may use also a middleware.

Please sign in or create an account to participate in this conversation.