laravel-language icon indicating copy to clipboard operation
laravel-language copied to clipboard

Default fallback language?

Open boonstoppel opened this issue 3 years ago • 3 comments

Is it possible to set a default fallback language?

My browser language is set to english, but my website only allows languages "de", "fr" and "it". Currently this will set "undefined" as language.

In the config have set 'auto' => true

boonstoppel avatar Mar 30 '22 13:03 boonstoppel

Also, for the scenario above, this code:

@foreach (language()->allowed() as $code => $name)
        <a href="{{ language()->back($code) }}">{{ $name }}</a>
@endforeach 

will return:

<a href="http://velodach.test/languages/de/back">Deutsch</a>
<a href="http://velodach.test/languages/fr/back">Français</a>
<a href="http://velodach.test/languages/it/back">Italiano</a>
<a href="http://velodach.test/languages/en/back">Unknown</a>

Notice the last line:

<a href="http://velodach.test/languages/en/back">Unknown</a>

boonstoppel avatar Mar 30 '22 13:03 boonstoppel

ping...

boonstoppel avatar Apr 27 '22 07:04 boonstoppel

ping...

pong )))

7dir avatar Jun 24 '22 04:06 7dir