I setup and configured all by instruction, even inserted required row into $middlewareGroups in Kernel, and I have this language list in config/locales.php:
'supported' => [
'en',
'de',
],
And that route:
/**
* Main page
*/
Route::multilingual('/', 'IndexController@index')->name('index');
And when I request site via mysite.com/de, {{ locale() }} returns de. But when I access site via mysite.com, {{ locale() }} return me de too, not en. How to solve that? And is it right practice to make translation for whole page content via code like this (in Blade template of page):
@if (locale() == 'de')
de content
@else
en content
@endif
I want to create pages like FAQ, About us, Contacts and more, supporting multiple languages (I think I'll have only two langs).
Thank you so much.
Describe the bug
I setup and configured all by instruction, even inserted required row into $middlewareGroups in Kernel, and I have this language list in
config/locales.php
:And that route:
And when I request site via
mysite.com/de
, {{ locale() }} returnsde
. But when I access site viamysite.com
, {{ locale() }} return mede
too, noten
. How to solve that? And is it right practice to make translation for whole page content via code like this (in Blade template of page):I want to create pages like FAQ, About us, Contacts and more, supporting multiple languages (I think I'll have only two langs). Thank you so much.