Browse Source

Small improvement on sidebar lang switcher

Add lang switcher tooltip and disabled button attribute to selected lang
Fix some missing customer lang value
pull/6/head
Nafies Luthfi 8 years ago
parent
commit
c0db7efa80
  1. 3
      resources/lang/en/customer.php
  2. 7
      resources/lang/en/lang.php
  3. 19
      resources/lang/id/customer.php
  4. 7
      resources/lang/id/lang.php
  5. 19
      resources/views/layouts/partials/sidebar.blade.php

3
resources/lang/en/customer.php

@ -5,11 +5,12 @@ return [
'customer' => 'Customer',
'list' => 'Customer List',
'search' => 'Search Customer',
'detail' => 'Customer Detail',
'not_found' => 'Customer not found.',
'empty' => 'Customer is empty.',
'back_to_show' => 'Back to Customer Detail',
'back_to_index' => 'Back to Customer List',
'detail' => 'Customer Detail',
'contact' => 'Customer Contact',
// Actions
'create' => 'Create new Customer',

7
resources/lang/en/lang.php

@ -1,7 +1,8 @@
<?php
return [
'lang' => 'Language',
'en' => 'English',
'id' => 'Bahasa',
'lang' => 'Language',
'switch_tooltip' => 'Switch language to :lang',
'en' => 'English',
'id' => 'Bahasa',
];

19
resources/lang/id/customer.php

@ -2,16 +2,15 @@
return [
// Labels
'customer' => 'Customer',
'list' => 'Daftar Customer',
'search' => 'Cari Customer',
'not_found' => 'Customer tidak ditemukan',
'empty' => 'Belum ada Customer',
'back_to_show' => 'Kembali ke detail Customer',
'back_to_index' => 'Kembali ke daftar Customer',
'type' => 'Jenis Customer',
'detail' => 'Detail Customer',
'contact' => 'Kontak Customer',
'customer' => 'Customer',
'list' => 'Daftar Customer',
'search' => 'Cari Customer',
'not_found' => 'Customer tidak ditemukan',
'empty' => 'Belum ada Customer',
'back_to_show' => 'Kembali ke detail Customer',
'back_to_index' => 'Kembali ke daftar Customer',
'detail' => 'Detail Customer',
'contact' => 'Kontak Customer',
// Actions
'create' => 'Input Customer Baru',

7
resources/lang/id/lang.php

@ -1,7 +1,8 @@
<?php
return [
'lang' => 'Bahasa',
'en' => 'Bahasa Inggris',
'id' => 'Bahasa Indonesia',
'lang' => 'Bahasa',
'switch_tooltip' => 'Ubah bahasa ke :lang',
'en' => 'Bahasa Inggris',
'id' => 'Bahasa Indonesia',
];

19
resources/views/layouts/partials/sidebar.blade.php

@ -14,16 +14,27 @@
<div class="small" style="margin-top:10px">{{ config('app.name') }}</div>
</a>
<div class="text-center" style="border-bottom: 1px solid #e7e7e7; padding-bottom: 10px">
{{ trans('lang.lang') }} :
{!! FormField::formButton(
['route' => 'users.profile.switch-lang', 'method' => 'patch'],
[
'route' => 'users.profile.switch-lang',
'method' => 'patch',
'title' => auth()->user()->lang != 'en' ? trans('lang.switch_tooltip', ['lang' => trans('lang.en')]) : ''
],
'EN',
['class' => 'btn btn-default btn-xs', 'id' => 'switch_lang_en'],
['class' => 'btn btn-default btn-xs', 'id' => 'switch_lang_en']
+ (auth()->user()->lang == 'en' ? ['disabled' => 'disabled'] : []),
['lang' => 'en']
) !!}
{!! FormField::formButton(
['route' => 'users.profile.switch-lang', 'method' => 'patch'],
[
'route' => 'users.profile.switch-lang',
'method' => 'patch',
'title' => auth()->user()->lang != 'id' ? trans('lang.switch_tooltip', ['lang' => trans('lang.id')]) : ''
],
'ID',
['class' => 'btn btn-default btn-xs', 'id' => 'switch_lang_id'],
['class' => 'btn btn-default btn-xs', 'id' => 'switch_lang_id']
+ (auth()->user()->lang == 'id' ? ['disabled' => 'disabled'] : []),
['lang' => 'id']
) !!}
</div>

Loading…
Cancel
Save