2016-09-26 22:13:39 +08:00
|
|
|
<!-- Language Menu -->
|
|
|
|
<li class="dropdown">
|
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
2018-08-08 12:30:50 +08:00
|
|
|
<i class="fas fa-language" aria-hidden="true"></i>
|
2016-12-30 15:57:03 +08:00
|
|
|
<span class="description-text">{{ config('locales.'.App::getLocale(), config('locales.'.config('app.fallback_locale')))['short_name'] }}</span>
|
2016-12-11 15:17:24 +08:00
|
|
|
<span class="caret"></span>
|
2016-09-26 22:13:39 +08:00
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
2016-12-30 15:57:03 +08:00
|
|
|
@foreach(config('locales') as $code => $langInfo)
|
2017-01-18 22:31:35 +08:00
|
|
|
@if (!isset($langInfo['alias']))
|
2017-05-06 21:50:17 +08:00
|
|
|
<?php
|
|
|
|
if (count($_GET) == 0) {
|
|
|
|
$link = "?lang=$code";
|
|
|
|
} elseif(isset($_GET['lang'])) {
|
|
|
|
$link = str_replace("lang={$_GET['lang']}", "lang=$code", $_SERVER['REQUEST_URI']);
|
|
|
|
} else {
|
|
|
|
$link = $_SERVER['REQUEST_URI']."&lang=$code";
|
|
|
|
}
|
|
|
|
?>
|
2017-07-14 08:47:42 +08:00
|
|
|
<li class="locale" data-code="{{ $code }}">
|
2017-05-06 21:50:17 +08:00
|
|
|
<a href="{{ $link }}">{{ $langInfo['name'] }}</a>
|
|
|
|
</li>
|
2017-01-18 22:31:35 +08:00
|
|
|
@endif
|
2016-09-26 22:13:39 +08:00
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
</li>
|