Skip to content

Commit

Permalink
Updated readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbn authored Jan 15, 2019
1 parent e393c16 commit 15cef45
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<li class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Languages
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
@foreach($languages as $key=>$lang)
<li class="{{ active_class(session('locale') == $key) }}">
<a href="{{route('locale',$key)}}"> {{ $lang }}</a>
</li>
@endforeach
</ul>
</li>

\Config::set('translatable.locales', config('marvin.languages')); //override translatable configuration
## Laravel-Localize

This package requires `propaganistas/laravel-intl` and auto registers a web middleware that sets user locales on session properly.

And also registers web routes as /locale/*key* for all available locales.

You can set your available locales on your projects by adding a locales key and an array to your `config/app.php`

```
'locale' => 'en',
'locales' => ['en','tr','es','de'],
```

And later on; if you visit any of the available locales from locale/en ; you'll it'll be saved to your session and all supported libraries (like jenssegers/date) will be responding as expected.


You can get more detailed information about supported packages from https://github.com/Propaganistas/Laravel-Intl

0 comments on commit 15cef45

Please sign in to comment.