Problem with languages in Arabic

Asked

Viewed 37 times

1

I have a language system in Arabic, I’m using their localization system. I have the system working, what happens and that when I return to the.com domain of the error I wanted there to show by default a language to define by me is possible ?

Route

Route::group(['prefix'=>'{lang}'], function (){
   Route::get('/', function ($lang) {
      App::setLocale($lang);
      return view('home');
   });
   Route::get('/login', function ($lang) {
      App::setLocale($lang);
      return view('login');
   });
   Route::get('/registo', function ($lang) {
      App::setLocale($lang);
      return view('registo');
   });
   Route::get('/termos', function ($lang) {
      App::setLocale($lang);
      return view('termos');
   });
   Route::get('/sobre', function ($lang) {
      App::setLocale($lang);
      return view('sobre');
   });
   Route::get('/contactos', function ($lang) {
      App::setLocale($lang);
      return view('contactos');
   });
});

Error

inserir a descrição da imagem aqui

  • if you do.com domain it gives the error, because you did not pass lang as prefix ?

  • and give this one if I rule.com, as I resolve ?

  • then, whether to store this lang in some Sesssion or cookie for this specific case. and test the input Route::get('/', function ($lang) {
 if (!empy($lang)) App::setLocale($lang);
 return view('home');
 });

  • Sorry though your default route has a prefix that’s the problem

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.