Skip to content

Commit

Permalink
Update README.md (#449)
Browse files Browse the repository at this point in the history
Updated "Creating a language selector" section to march fix from #439
  • Loading branch information
ashatrov authored and Marc Cámara committed May 11, 2017
1 parent 29f9ea2 commit f1dbc41
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,17 @@ This function will return the [ISO 15924](http://www.unicode.org/iso15924) code
If you're supporting multiple locales in your project you will probably want to provide the users with a way to change language. Below is a simple example of blade template code you can use to create your own language selector.

```
<ul class="language_bar_chooser">
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
<ul>
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
<li>
<a rel="alternate" hreflang="{{$localeCode}}" href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">
<a rel="alternate" hreflang="{{ $localeCode }}" href="{{ LaravelLocalization::getLocalizedURL($localeCode, null, [], true) }}">
{{ $properties['native'] }}
</a>
</li>
@endforeach
@endforeach
</ul>
```
Here default language will be forced in getLocalizedURL() to be present in the URL even `hideDefaultLocaleInURL = true`.

## Translated Routes

Expand Down

0 comments on commit f1dbc41

Please sign in to comment.