I
I
Ivan2020-06-02 18:40:57
Laravel
Ivan, 2020-06-02 18:40:57

How to configure localization in VUE CLI frontnet and Laravel backend?

There is a bunch of vue cli frontend and laravel 7 backend. How to set up so that when choosing a language on the frontend, the backend gives translations in this language? Everywhere writes something like this

Route::get('welcome/{locale}', function ($locale) {
    if (! in_array($locale, ['en', 'es', 'fr'])) {
        abort(400);
    }

    App::setLocale($locale);

    //
});

but this is for Laravel as such, but I can’t find how it is divided into front and back.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazizbek Ergashev, 2020-06-02
@Djonson86

We have a package for this, please visit this page https://laravel-news.com/laravel-localization-vue-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question