enhance style of language select

This commit is contained in:
printempw 2016-12-30 15:57:03 +08:00
parent e0a4667cc8
commit 75431a14ca
2 changed files with 11 additions and 5 deletions

View File

@ -9,6 +9,12 @@ return [
| Available Languages
|
*/
'zh_CN' => '简体中文',
'en' => 'English'
'zh_CN' => [
'name' => '中文 (中国)',
'short_name' => 'ZH (CN)',
],
'en' => [
'name' => 'English',
'short_name' => 'EN',
],
];

View File

@ -2,12 +2,12 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-language" aria-hidden="true"></i>
<span class="description-text">Language</span>
<span class="description-text">{{ config('locales.'.App::getLocale(), config('locales.'.config('app.fallback_locale')))['short_name'] }}</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
@foreach(config('locales') as $locale => $lang)
<li class="locale"><a href="{{ url('/locale/'.$locale) }}">{{ $lang }}</a></li>
@foreach(config('locales') as $code => $langInfo)
<li class="locale"><a href="{{ url('/locale/'.$code) }}">{{ $langInfo['name'] }}</a></li>
@endforeach
</ul>
</li>