R
R
Rishat Sultanov2017-03-28 19:04:32
Laravel
Rishat Sultanov, 2017-03-28 19:04:32

How to check the locale in the controller?

Good evening gentlemen.
Implementing a feedback form.
In event handlers if everything was sent successfully. Then the user is redirected to the home page with its localization (the desired language)
And a notification is displayed to him:

IndexController

flash()->overlay('Ваше письмо было доставлено!', 'Уведомление'); // Уведомление
        return redirect('/'); // Перенаправляем

notice : https://github.com/laracasts/flash _ _ _ _ Can I get around this?
{{ trans('routes.sendmessage') }}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-03-28
@e_snegirev

You can find out the navigator language on the client and send it with the form
Either Accept-Language header in the header in the north to pull out

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question