@@ -8,20 +8,20 @@
@if (request('action') == 'delete' && $singleMstr)
@can('delete', $singleMstr)
-
{{ trans('master.edit') }}
+
{{ __('master.edit') }}
{!! Form::model($singleMstr, ['route' => ['masters.update', $singleMstr],'method' => 'patch']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('master.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('master.description')]) !!}
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
{!! Form::close() !!}
diff --git a/src/stubs/view-forms.stub b/src/stubs/view-forms.stub
index 9a3f8ad..a6c553f 100644
--- a/src/stubs/view-forms.stub
+++ b/src/stubs/view-forms.stub
@@ -1,30 +1,30 @@
@if (Request::get('action') == 'create')
@can('create', new fullMstr)
{!! Form::open(['route' => 'masters.store']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('master.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('master.description')]) !!}
- {!! Form::submit(trans('master.create'), ['class' => 'btn btn-success']) !!}
- {{ link_to_route('masters.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }}
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
+ {!! Form::submit(__('master.create'), ['class' => 'btn btn-success']) !!}
+ {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }}
{!! Form::close() !!}
@endcan
@endif
@if (Request::get('action') == 'edit' && $editableMaster)
@can('update', $editableMaster)
{!! Form::model($editableMaster, ['route' => ['masters.update', $editableMaster], 'method' => 'patch']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('master.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('master.description')]) !!}
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
@if (request('q'))
{{ Form::hidden('q', request('q')) }}
@endif
@if (request('page'))
{{ Form::hidden('page', request('page')) }}
@endif
- {!! Form::submit(trans('master.update'), ['class' => 'btn btn-success']) !!}
- {{ link_to_route('masters.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }}
+ {!! Form::submit(__('master.update'), ['class' => 'btn btn-success']) !!}
+ {{ link_to_route('masters.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }}
@can('delete', $singleMstr)
{!! link_to_route(
'masters.index',
- trans('app.delete'),
+ __('app.delete'),
['action' => 'delete', 'id' => $singleMstr->id] + Request::only('page', 'q'),
['id' => 'del-master-'.$singleMstr->id, 'class' => 'btn btn-danger pull-right']
) !!}
@@ -35,20 +35,20 @@
@if (Request::get('action') == 'delete' && $editableMaster)
@can('delete', $editableMaster)
-
{{ trans('master.delete') }}
+
{{ __('master.delete') }}
-
+
{{ $editableMaster->name }}
-
+
{{ $editableMaster->description }}
{!! $errors->first('master_id', '
:message') !!}
-
{{ trans('app.delete_confirm') }}
+
{{ __('app.delete_confirm') }}
@endcan
diff --git a/src/stubs/view-index-full.stub b/src/stubs/view-index-full.stub
index 7c40250..f82cdd3 100644
--- a/src/stubs/view-index-full.stub
+++ b/src/stubs/view-index-full.stub
@@ -1,34 +1,34 @@
@extends('layouts.app')
-@section('title', trans('master.list'))
+@section('title', __('master.list'))
@section('content')
{{ Form::open(['method' => 'get','class' => 'form-inline']) }}
- {!! FormField::text('q', ['value' => request('q'), 'label' => trans('master.search'), 'class' => 'input-sm']) !!}
- {{ Form::submit(trans('master.search'), ['class' => 'btn btn-sm']) }}
- {{ link_to_route('masters.index', trans('app.reset')) }}
+ {!! FormField::text('q', ['value' => request('q'), 'label' => __('master.search'), 'class' => 'input-sm']) !!}
+ {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }}
+ {{ link_to_route('masters.index', __('app.reset')) }}
{{ Form::close() }}
- | {{ trans('app.table_no') }} |
- {{ trans('master.name') }} |
- {{ trans('master.description') }} |
- {{ trans('app.action') }} |
+ {{ __('app.table_no') }} |
+ {{ __('master.name') }} |
+ {{ __('master.description') }} |
+ {{ __('app.action') }} |
@@ -41,7 +41,7 @@
@can('view', $singleMstr)
{!! link_to_route(
'masters.show',
- trans('app.show'),
+ __('app.show'),
[$singleMstr],
['class' => 'btn btn-default btn-xs', 'id' => 'show-master-' . $singleMstr->id]
) !!}
diff --git a/src/stubs/view-index-simple.stub b/src/stubs/view-index-simple.stub
index 5c2e043..c244601 100644
--- a/src/stubs/view-index-simple.stub
+++ b/src/stubs/view-index-simple.stub
@@ -1,34 +1,34 @@
@extends('layouts.app')
-@section('title', trans('master.list'))
+@section('title', __('master.list'))
@section('content')
{{ Form::open(['method' => 'get', 'class' => 'form-inline']) }}
- {!! FormField::text('q', ['value' => request('q'), 'label' => trans('master.search'), 'class' => 'input-sm']) !!}
- {{ Form::submit(trans('master.search'), ['class' => 'btn btn-sm']) }}
- {{ link_to_route('masters.index', trans('app.reset')) }}
+ {!! FormField::text('q', ['value' => request('q'), 'label' => __('master.search'), 'class' => 'input-sm']) !!}
+ {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }}
+ {{ link_to_route('masters.index', __('app.reset')) }}
{{ Form::close() }}
- | {{ trans('app.table_no') }} |
- {{ trans('master.name') }} |
- {{ trans('master.description') }} |
- {{ trans('app.action') }} |
+ {{ __('app.table_no') }} |
+ {{ __('master.name') }} |
+ {{ __('master.description') }} |
+ {{ __('app.action') }} |
@@ -41,7 +41,7 @@
@can('update', $singleMstr)
{!! link_to_route(
'masters.index',
- trans('app.edit'),
+ __('app.edit'),
['action' => 'edit', 'id' => $singleMstr->id] + Request::only('page', 'q'),
['id' => 'edit-master-'.$singleMstr->id]
) !!}
diff --git a/src/stubs/view-show.stub b/src/stubs/view-show.stub
index 4f6ca54..d115485 100644
--- a/src/stubs/view-show.stub
+++ b/src/stubs/view-show.stub
@@ -1,23 +1,23 @@
@extends('layouts.app')
-@section('title', trans('master.detail'))
+@section('title', __('master.detail'))
@section('content')
-
{{ trans('master.detail') }}
+
{{ __('master.detail') }}
- | {{ trans('master.name') }} | {{ $singleMstr->name }} |
- | {{ trans('master.description') }} | {{ $singleMstr->description }} |
+ | {{ __('master.name') }} | {{ $singleMstr->name }} |
+ | {{ __('master.description') }} | {{ $singleMstr->description }} |
diff --git a/tests/Generators/ModelGeneratorTest.php b/tests/Generators/ModelGeneratorTest.php
index 324eb8c..98a3e6c 100644
--- a/tests/Generators/ModelGeneratorTest.php
+++ b/tests/Generators/ModelGeneratorTest.php
@@ -27,9 +27,9 @@ class {$this->model_name} extends Model
public function getNameLinkAttribute()
{
return link_to_route('{$this->table_name}.show', \$this->name, [\$this], [
- 'title' => trans(
+ 'title' => __(
'app.show_detail_title',
- ['name' => \$this->name, 'type' => trans('{$this->lang_name}.{$this->lang_name}')]
+ ['name' => \$this->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')]
),
]);
}
@@ -64,9 +64,9 @@ class Category extends Model
public function getNameLinkAttribute()
{
return link_to_route('categories.show', \$this->name, [\$this], [
- 'title' => trans(
+ 'title' => __(
'app.show_detail_title',
- ['name' => \$this->name, 'type' => trans('category.category')]
+ ['name' => \$this->name, 'type' => __('category.category')]
),
]);
}
diff --git a/tests/Generators/ModelTestGeneratorTest.php b/tests/Generators/ModelTestGeneratorTest.php
index cfdd224..525c06f 100644
--- a/tests/Generators/ModelTestGeneratorTest.php
+++ b/tests/Generators/ModelTestGeneratorTest.php
@@ -33,9 +33,9 @@ class {$this->model_name}Test extends TestCase
\$this->assertEquals(
link_to_route('{$this->table_name}.show', \${$this->single_model_var_name}->name, [\${$this->single_model_var_name}], [
- 'title' => trans(
+ 'title' => __(
'app.show_detail_title',
- ['name' => \${$this->single_model_var_name}->name, 'type' => trans('{$this->lang_name}.{$this->lang_name}')]
+ ['name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')]
),
]), \${$this->single_model_var_name}->name_link
);
@@ -84,9 +84,9 @@ class {$this->model_name}Test extends TestCase
\$this->assertEquals(
link_to_route('{$this->table_name}.show', \${$this->single_model_var_name}->name, [\${$this->single_model_var_name}], [
- 'title' => trans(
+ 'title' => __(
'app.show_detail_title',
- ['name' => \${$this->single_model_var_name}->name, 'type' => trans('{$this->lang_name}.{$this->lang_name}')]
+ ['name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')]
),
]), \${$this->single_model_var_name}->name_link
);
diff --git a/tests/Generators/Simple/ViewsGeneratorTest.php b/tests/Generators/Simple/ViewsGeneratorTest.php
index 4a41caa..eaca41e 100644
--- a/tests/Generators/Simple/ViewsGeneratorTest.php
+++ b/tests/Generators/Simple/ViewsGeneratorTest.php
@@ -16,35 +16,35 @@ class ViewsGeneratorTest extends TestCase
$this->assertFileExists($indexViewPath);
$indexViewContent = "@extends('layouts.app')
-@section('title', trans('{$this->lang_name}.list'))
+@section('title', __('{$this->lang_name}.list'))
@section('content')
{{ Form::open(['method' => 'get', 'class' => 'form-inline']) }}
- {!! FormField::text('q', ['value' => request('q'), 'label' => trans('{$this->lang_name}.search'), 'class' => 'input-sm']) !!}
- {{ Form::submit(trans('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }}
- {{ link_to_route('{$this->table_name}.index', trans('app.reset')) }}
+ {!! FormField::text('q', ['value' => request('q'), 'label' => __('{$this->lang_name}.search'), 'class' => 'input-sm']) !!}
+ {{ Form::submit(__('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }}
+ {{ link_to_route('{$this->table_name}.index', __('app.reset')) }}
{{ Form::close() }}
- | {{ trans('app.table_no') }} |
- {{ trans('{$this->lang_name}.name') }} |
- {{ trans('{$this->lang_name}.description') }} |
- {{ trans('app.action') }} |
+ {{ __('app.table_no') }} |
+ {{ __('{$this->lang_name}.name') }} |
+ {{ __('{$this->lang_name}.description') }} |
+ {{ __('app.action') }} |
@@ -57,7 +57,7 @@ class ViewsGeneratorTest extends TestCase
@can('update', \${$this->single_model_var_name})
{!! link_to_route(
'{$this->table_name}.index',
- trans('app.edit'),
+ __('app.edit'),
['action' => 'edit', 'id' => \${$this->single_model_var_name}->id] + Request::only('page', 'q'),
['id' => 'edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id]
) !!}
@@ -91,30 +91,30 @@ class ViewsGeneratorTest extends TestCase
$formViewContent = "@if (Request::get('action') == 'create')
@can('create', new {$this->full_model_name})
{!! Form::open(['route' => '{$this->table_name}.store']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}
- {!! Form::submit(trans('{$this->lang_name}.create'), ['class' => 'btn btn-success']) !!}
- {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }}
+ {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
+ {!! Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) !!}
+ {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }}
{!! Form::close() !!}
@endcan
@endif
@if (Request::get('action') == 'edit' && \$editable{$this->model_name})
@can('update', \$editable{$this->model_name})
{!! Form::model(\$editable{$this->model_name}, ['route' => ['{$this->table_name}.update', \$editable{$this->model_name}], 'method' => 'patch']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}
+ {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
@if (request('q'))
{{ Form::hidden('q', request('q')) }}
@endif
@if (request('page'))
{{ Form::hidden('page', request('page')) }}
@endif
- {!! Form::submit(trans('{$this->lang_name}.update'), ['class' => 'btn btn-success']) !!}
- {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }}
+ {!! Form::submit(__('{$this->lang_name}.update'), ['class' => 'btn btn-success']) !!}
+ {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }}
@can('delete', \${$this->single_model_var_name})
{!! link_to_route(
'{$this->table_name}.index',
- trans('app.delete'),
+ __('app.delete'),
['action' => 'delete', 'id' => \${$this->single_model_var_name}->id] + Request::only('page', 'q'),
['id' => 'del-{$this->lang_name}-'.\${$this->single_model_var_name}->id, 'class' => 'btn btn-danger pull-right']
) !!}
@@ -125,20 +125,20 @@ class ViewsGeneratorTest extends TestCase
@if (Request::get('action') == 'delete' && \$editable{$this->model_name})
@can('delete', \$editable{$this->model_name})
-
{{ trans('{$this->lang_name}.delete') }}
+
{{ __('{$this->lang_name}.delete') }}
-
+
{{ \$editable{$this->model_name}->name }}
-
+
{{ \$editable{$this->model_name}->description }}
{!! \$errors->first('{$this->lang_name}_id', '
:message') !!}
-
{{ trans('app.delete_confirm') }}
+
{{ __('app.delete_confirm') }}
@endcan
diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php
index 4001506..b41bae3 100644
--- a/tests/Generators/ViewsGeneratorTest.php
+++ b/tests/Generators/ViewsGeneratorTest.php
@@ -16,35 +16,35 @@ class ViewsGeneratorTest extends TestCase
$this->assertFileExists($indexViewPath);
$indexViewContent = "@extends('layouts.app')
-@section('title', trans('{$this->lang_name}.list'))
+@section('title', __('{$this->lang_name}.list'))
@section('content')
{{ Form::open(['method' => 'get','class' => 'form-inline']) }}
- {!! FormField::text('q', ['value' => request('q'), 'label' => trans('{$this->lang_name}.search'), 'class' => 'input-sm']) !!}
- {{ Form::submit(trans('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }}
- {{ link_to_route('{$this->table_name}.index', trans('app.reset')) }}
+ {!! FormField::text('q', ['value' => request('q'), 'label' => __('{$this->lang_name}.search'), 'class' => 'input-sm']) !!}
+ {{ Form::submit(__('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }}
+ {{ link_to_route('{$this->table_name}.index', __('app.reset')) }}
{{ Form::close() }}
- | {{ trans('app.table_no') }} |
- {{ trans('{$this->lang_name}.name') }} |
- {{ trans('{$this->lang_name}.description') }} |
- {{ trans('app.action') }} |
+ {{ __('app.table_no') }} |
+ {{ __('{$this->lang_name}.name') }} |
+ {{ __('{$this->lang_name}.description') }} |
+ {{ __('app.action') }} |
@@ -57,7 +57,7 @@ class ViewsGeneratorTest extends TestCase
@can('view', \${$this->single_model_var_name})
{!! link_to_route(
'{$this->table_name}.show',
- trans('app.show'),
+ __('app.show'),
[\${$this->single_model_var_name}],
['class' => 'btn btn-default btn-xs', 'id' => 'show-{$this->lang_name}-' . \${$this->single_model_var_name}->id]
) !!}
@@ -85,24 +85,24 @@ class ViewsGeneratorTest extends TestCase
$this->assertFileExists($showFormViewPath);
$showFormViewContent = "@extends('layouts.app')
-@section('title', trans('{$this->lang_name}.detail'))
+@section('title', __('{$this->lang_name}.detail'))
@section('content')
-
{{ trans('{$this->lang_name}.detail') }}
+
{{ __('{$this->lang_name}.detail') }}
- | {{ trans('{$this->lang_name}.name') }} | {{ \${$this->single_model_var_name}->name }} |
- | {{ trans('{$this->lang_name}.description') }} | {{ \${$this->single_model_var_name}->description }} |
+ | {{ __('{$this->lang_name}.name') }} | {{ \${$this->single_model_var_name}->name }} |
+ | {{ __('{$this->lang_name}.description') }} | {{ \${$this->single_model_var_name}->description }} |
@@ -121,21 +121,21 @@ class ViewsGeneratorTest extends TestCase
$this->assertFileExists($createFormViewPath);
$createFormViewContent = "@extends('layouts.app')
-@section('title', trans('{$this->lang_name}.create'))
+@section('title', __('{$this->lang_name}.create'))
@section('content')
-
{{ trans('{$this->lang_name}.create') }}
+
{{ __('{$this->lang_name}.create') }}
{!! Form::open(['route' => '{$this->table_name}.store']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}
+ {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
{!! Form::close() !!}
@@ -155,7 +155,7 @@ class ViewsGeneratorTest extends TestCase
$this->assertFileExists($editFormViewPath);
$editFormViewContent = "@extends('layouts.app')
-@section('title', trans('{$this->lang_name}.edit'))
+@section('title', __('{$this->lang_name}.edit'))
@section('content')
@@ -163,20 +163,20 @@ class ViewsGeneratorTest extends TestCase
@if (request('action') == 'delete' && \${$this->single_model_var_name})
@can('delete', \${$this->single_model_var_name})
-
{{ trans('{$this->lang_name}.delete') }}
+
{{ __('{$this->lang_name}.delete') }}
-
+
{{ \${$this->single_model_var_name}->name }}
-
+
{{ \${$this->single_model_var_name}->description }}
{!! \$errors->first('{$this->lang_name}_id', '
:message') !!}
-
{{ trans('app.delete_confirm') }}
+
{{ __('app.delete_confirm') }}
@endcan
@else
-
{{ trans('{$this->lang_name}.edit') }}
+
{{ __('{$this->lang_name}.edit') }}
{!! Form::model(\${$this->single_model_var_name}, ['route' => ['{$this->table_name}.update', \${$this->single_model_var_name}],'method' => 'patch']) !!}
- {!! FormField::text('name', ['required' => true, 'label' => trans('{$this->lang_name}.name')]) !!}
- {!! FormField::textarea('description', ['label' => trans('{$this->lang_name}.description')]) !!}
+ {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!}
+ {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
{!! Form::close() !!}