From 93b7d88f429513d834059e20ad8bf810cac447a2 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Tue, 29 Aug 2017 22:44:41 +0800 Subject: [PATCH] Update profile edit page to use trans helper --- resources/lang/en/app.php | 6 ++++++ resources/lang/en/user.php | 1 + resources/lang/id/app.php | 6 ++++++ resources/lang/id/user.php | 1 + resources/views/auth/register.blade.php | 2 +- resources/views/users/edit.blade.php | 38 ++++++++++++++++----------------- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/resources/lang/en/app.php b/resources/lang/en/app.php index 4ac0bda..97d4bb6 100644 --- a/resources/lang/en/app.php +++ b/resources/lang/en/app.php @@ -16,6 +16,12 @@ return [ 'user_found' => ':total found with keyword : :keyword', 'search_your_family' => 'Search Your Family', 'search_your_family_placeholder' => 'Enter name/nickname... click Search', + 'example' => 'Eg.', + 'address' => 'Address', + 'contact' => 'Contact', + 'city' => 'City', + 'phone' => 'Phone', + 'login_account' => 'Login Account', // Actions 'edit' => 'Edit', diff --git a/resources/lang/en/user.php b/resources/lang/en/user.php index d9772d1..4e277ff 100644 --- a/resources/lang/en/user.php +++ b/resources/lang/en/user.php @@ -18,6 +18,7 @@ return [ 'nieces' => 'Nieces', // Actions + 'edit' => 'Edit Profile', 'set_father' => 'Set Father', 'set_mother' => 'Set Mother', 'set_parent' => 'Set Parent', diff --git a/resources/lang/id/app.php b/resources/lang/id/app.php index 5f9ed76..13e32b0 100644 --- a/resources/lang/id/app.php +++ b/resources/lang/id/app.php @@ -16,6 +16,12 @@ return [ 'user_found' => 'User ditemukan : :total Orang untuk kata kunci : :keyword', 'search_your_family' => 'Cari Keluarga Anda', 'search_your_family_placeholder' => 'Masukkan nama/panggilan... klik Cari', + 'example' => 'Misal:', + 'address' => 'Alamat', + 'contact' => 'Kontak', + 'city' => 'Kota', + 'phone' => 'Telp.', + 'login_account' => 'Akun Login', // Actions 'edit' => 'Edit', diff --git a/resources/lang/id/user.php b/resources/lang/id/user.php index 2a5acaf..d752764 100644 --- a/resources/lang/id/user.php +++ b/resources/lang/id/user.php @@ -18,6 +18,7 @@ return [ 'nieces' => 'Keponakan', // Actions + 'edit' => 'Edit Profil', 'set_father' => 'Set Ayah', 'set_mother' => 'Set Ibu', 'set_parent' => 'Set Orang Tua', diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 4206301..d259116 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -56,7 +56,7 @@
- {!! FormField::radios('gender_id', [1 => 'Laki-laki', 2 => 'Perempuan'], ['label' => false]) !!} + {!! FormField::radios('gender_id', [1 => trans('app.male'), 2 => trans('app.female')], ['label' => false]) !!}
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 63ab744..420b2bd 100644 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -3,52 +3,52 @@ @section('content') - {{ Form::model($user, ['route' => ['users.update', $user->id], 'method' =>'patch', 'autocomplete' => 'nope']) }} + {{ Form::model($user, ['route' => ['users.update', $user->id], 'method' =>'patch', 'autocomplete' => 'off']) }}
-

Edit Profil

+

{{ trans('user.edit') }}

- {!! FormField::text('name', ['label' => 'Nama']) !!} - {!! FormField::text('nickname', ['label' => 'Nama Panggilan']) !!} + {!! FormField::text('name', ['label' => trans('user.name')]) !!} + {!! FormField::text('nickname', ['label' => trans('user.nickname')]) !!}
-
{!! FormField::radios('gender_id', [1 => 'L', 'P'], ['label' => 'Jenis Kelamin']) !!}
-
{!! FormField::text('dob', ['label' => 'Tanggal Lahir', 'placeholder' => 'Misal: 1959-07-20']) !!}
+
{!! FormField::radios('gender_id', [1 => trans('app.male_code'), trans('app.female_code')], ['label' => trans('user.gender')]) !!}
+
{!! FormField::text('dob', ['label' => trans('user.dob'), 'placeholder' => trans('app.example').' 1959-07-20']) !!}
-
{!! FormField::text('yod', ['label' => 'Tahun Meninggal', 'placeholder' => 'Misal: 2003']) !!}
-
{!! FormField::text('dod', ['label' => 'Tanggal Meninggal', 'placeholder' => 'Misal: 2003-10-17']) !!}
+
{!! FormField::text('yod', ['label' => trans('user.yod'), 'placeholder' => trans('app.example').' 2003']) !!}
+
{!! FormField::text('dod', ['label' => trans('user.dod'), 'placeholder' => trans('app.example').' 2003-10-17']) !!}
-

Edit Alamat dan Kontak

+

{{ trans('app.address') }} & {{ trans('app.contact') }}

- {!! FormField::textarea('address', ['label' => 'Alamat']) !!} - {!! FormField::text('city', ['label' => 'Kota']) !!} - {!! FormField::text('phone', ['label' => 'Telp', 'placeholder' => 'Misal: 081234567890']) !!} + {!! FormField::textarea('address', ['label' => trans('app.address')]) !!} + {!! FormField::text('city', ['label' => trans('app.city'), 'placeholder' => trans('app.example').' Jakarta']) !!} + {!! FormField::text('phone', ['label' => trans('app.phone'), 'placeholder' => trans('app.example').' 081234567890']) !!}
-

Akun Login

+

{{ trans('app.login_account') }}

- {!! FormField::email('email', ['label' => 'Email', 'placeholder' => 'Misal: nama@mail.com', 'autocomplete' => 'off']) !!} - {!! FormField::password('password', ['label' => 'Password', 'placeholder' => '******', 'autocomplete' => 'off']) !!} + {!! FormField::email('email', ['label' => trans('auth.email'), 'placeholder' => trans('app.example').' nama@mail.com']) !!} + {!! FormField::text('password', ['label' => trans('auth.password'), 'placeholder' => '******', 'value' => '']) !!}
- {{ Form::submit('Update', ['class' => 'btn btn-primary']) }} - {{ link_to_route('users.show', 'Cancel', [$user->id], ['class' => 'btn btn-default']) }} + {{ Form::submit(trans('app.update'), ['class' => 'btn btn-primary']) }} + {{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default']) }}
{{ Form::close() }} @endsection