Added localized strings for custom_fields

This commit is contained in:
Wächtler, Yannick 2021-11-02 11:27:53 +01:00
parent c11af0e222
commit a96c53784c
8 changed files with 43 additions and 28 deletions

View file

@ -2,6 +2,7 @@
return [
'custom_fields' => 'Custom Fields',
'manage' => 'Manage',
'field' => 'Field',
'about_fieldsets_title' => 'About Fieldsets',
'about_fieldsets_text' => 'Fieldsets allow you to create groups of custom fields that are frequently re-used for specific asset model types.',
@ -26,7 +27,19 @@ return [
'used_by_models' => 'Used By Models',
'order' => 'Order',
'create_fieldset' => 'New Fieldset',
'create_fieldset_title' => 'Create a new fieldset',
'create_field' => 'New Custom Field',
'create_field_title' => 'Create a new custom field',
'value_encrypted' => 'The value of this field is encrypted in the database. Only admin users will be able to view the decrypted value',
'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails.',
'help_text' => 'Help Text',
'help_text_description' => 'This is optional text that will appear below the form elements while editing an asset to provide context on the field.',
'about_custom_fields_title' => 'About Custom Fields',
'about_custom_fields_text' => 'Custom fields allow you to add arbitrary attributes to assets.',
'add_field_to_fieldset' => 'Add Field to Fieldset',
'make_optional' => 'Required - click to make optional',
'make_required' => 'Optional - click to make required',
'reorder' => 'Reorder',
'db_field' => 'DB Field',
'db_convert_warning' => 'WARNING. This field is in the custom fields table as <code> :db_column </code> but should be :expected </code>.'
];

View file

@ -8,6 +8,7 @@ return [
'delete' => 'Delete',
'edit' => 'Edit',
'restore' => 'Restore',
'remove' => 'Remove',
'request' => 'Request',
'submit' => 'Submit',
'upload' => 'Upload',

View file

@ -6,7 +6,6 @@
'accessory' => 'Accessory',
'accessory_report' => 'Accessory Report',
'action' => 'Action',
'actions' => 'Actions',
'activity_report' => 'Activity Report',
'address' => 'Address',
'admin' => 'Admin',
@ -261,4 +260,6 @@
'hide_help' => 'Hide help',
'view_all' => 'view all',
'hide_deleted' => 'Hide Deleted',
'email' => 'Email',
'Help'
];

View file

@ -35,7 +35,7 @@
<thead>
<tr>
<th>{{ trans('general.name')}}</th>
<th>{{ trans('general.actions')}}</th>
<th>{{ trans('button.actions')}}</th>
</tr>
</thead>
<tbody>

View file

@ -96,11 +96,11 @@
<!-- Help Text -->
<div class="form-group {{ $errors->has('help_text') ? ' has-error' : '' }}">
<label for="help_text" class="col-md-4 control-label">
Help Text
{{ trans('admin/custom_fields/general.help_text') }}
</label>
<div class="col-md-6">
{{ Form::text('help_text', old('help_text', $field->help_text), array('class' => 'form-control', 'aria-label'=>'help_text')) }}
<p class="help-block">This is optional text that will appear below the form elements while editing an asset to provide context on the field.</p>
<p class="help-block">{{ trans('admin/custom_fields/general.help_text_description') }}</p>
{!! $errors->first('help_text', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
@ -147,8 +147,8 @@
</div> <!--/.col-md-9-->
<div class="col-md-3">
<h2>About Custom Fields</h2>
<p>Custom fields allow you to add arbitrary attributes to assets.</p>
<h2>{{ trans('admin/custom_fields/general.about_custom_fields_title') }}</h2>
<p>{{ trans('admin/custom_fields/general.about_custom_fields_text') }}</p>
</div>
</div>

View file

@ -42,8 +42,8 @@
{{ Form::close() }}
</div>
<div class="col-md-3">
<h2>About Fieldsets</h4>
<p>Fieldsets work like containers of the custom fields you've created. This allows you to group commonly used custom attributes together for easy associations. </p>
<h2>{{ trans('admin/custom_fields/general.about_fieldsets_title') }}</h4>
<p>{{ trans('admin/custom_fields/general.about_fieldsets_text') }}</p>
</div>
</div>
@stop

View file

@ -27,7 +27,7 @@
<tr>
{{-- Hide the sorting handle if we can't update the fieldset --}}
@can('update', $custom_fieldset)
<th class="col-md-1"><span class="sr-only">Reorder</span></th>
<th class="col-md-1"><span class="sr-only">{{ trans('admin/custom_fields/general.reorder') }}</span></th>
@endcan
<th class="col-md-1">{{ trans('admin/custom_fields/general.order') }}</th>
<th class="col-md-3">{{ trans('admin/custom_fields/general.field_name') }}</th>
@ -35,7 +35,7 @@
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_element') }}</th>
<th class="col-md-1">{{ trans('admin/custom_fields/general.encrypted') }}</th>
<th class="col-md-1">{{ trans('admin/custom_fields/general.required') }}</th>
<th class="col-md-1"><span class="sr-only">Remove</span></th>
<th class="col-md-1"><span class="sr-only">{{ trans('button.remove') }}</span></th>
</tr>
</thead>
<tbody>
@ -60,18 +60,18 @@
@if ($field->pivot->required)
<a href="{{ route('fields.optional', [$custom_fieldset->id, $field->id]) }}">
<i class="fas fa-check text-success" aria-hidden="true"></i>
<span class="sr-only">Required - click to make optional</span>
<span class="sr-only">{{ trans('admin/custom_fields/general.make_optional') }}</span>
</a>
@else
<a href="{{ route('fields.required', [$custom_fieldset->id, $field->id]) }}">
<i class="fas fa-times text-danger" aria-hidden="true"></i>
<span class="sr-only">Optional - click to make required</span>
<span class="sr-only">{{ trans('admin/custom_fields/general.make_required') }}</span>
</a>
@endif
</td>
<td>
@can('update', $custom_fieldset)
<a href="{{ route('fields.disassociate', [$field, $custom_fieldset->id]) }}" class="btn btn-sm btn-danger">Remove</a>
<a href="{{ route('fields.disassociate', [$field, $custom_fieldset->id]) }}" class="btn btn-sm btn-danger">{{ trans('button.remove') }}</a>
@endcan
</td>
</tr>
@ -89,7 +89,7 @@
<div class="form-group col-md-4">
<label for="field_id" class="sr-only">
Add Field to Fieldset
{{ trans('admin/custom-field/general.add_field_to_fieldset')}}
</label>
{{ Form::select("field_id",$custom_fields_list,"",['aria-label'=>'field_id', 'class'=>'select2']) }}
@ -106,7 +106,7 @@
<div class="form-group col-md-2">
{{ Form::text('order', $maxid, array('class' => 'form-control col-sm-1 col-md-1', 'style'=> 'width: 80px; padding-;right: 10px;', 'aria-label'=>'order', 'maxlength'=>'3', 'size'=>'3')) }}
<label for="order"> Order </label>
<label for="order">{{ trans('admin/custom_fields/general.order') }}</label>
</div>
<div class="form-group col-md-3">

View file

@ -6,7 +6,7 @@
{{-- Page title --}}
@section('title')
Manage {{ trans('admin/custom_fields/general.custom_fields') }}
{{ trans('admin/custom_fields/general.manage') }} {{ trans('admin/custom_fields/general.custom_fields') }}
@parent
@stop
@ -21,7 +21,7 @@
<h2 class="box-title">{{ trans('admin/custom_fields/general.fieldsets') }}</h2>
<div class="box-tools pull-right">
@can('create', \App\Models\CustomFieldset::class)
<a href="{{ route('fieldsets.create') }}" class="btn btn-sm btn-primary" data-toggle="tooltip" title="Create a new fieldset">{{ trans('admin/custom_fields/general.create_fieldset') }}</a>
<a href="{{ route('fieldsets.create') }}" class="btn btn-sm btn-primary" data-toggle="tooltip" title="{{ trans('admin/custom_fields/general.create_fieldset_title') }}">{{ trans('admin/custom_fields/general.create_fieldset') }}</a>
@endcan
</div>
</div><!-- /.box-header -->
@ -48,7 +48,7 @@
<th>{{ trans('general.name') }}</th>
<th>{{ trans('admin/custom_fields/general.qty_fields') }}</th>
<th>{{ trans('admin/custom_fields/general.used_by_models') }}</th>
<th>Actions</th>
<th>{{ trans('button.actions') }}</th>
</tr>
</thead>
@ -100,7 +100,7 @@
<h2 class="box-title">{{ trans('admin/custom_fields/general.custom_fields') }}</h2>
<div class="box-tools pull-right">
@can('create', \App\Models\CustomField::class)
<a href="{{ route('fields.create') }}" class="btn btn-sm btn-primary" data-toggle="tooltip" title="Create a new custom field">{{ trans('admin/custom_fields/general.create_field') }}</a>
<a href="{{ route('fields.create') }}" class="btn btn-sm btn-primary" data-toggle="tooltip" title="{{ trans('admin/custom_fields/general.create_field_title') }}">{{ trans('admin/custom_fields/general.create_field') }}</a>
@endcan
</div>
@ -127,13 +127,13 @@
<thead>
<tr>
<th data-searchable="true">{{ trans('general.name') }}</th>
<th data-searchable="true">Help Text</th>
<th data-searchable="true">Email</th>
<th data-visible="false">DB Field</th>
<th data-searchable="true">{{ trans('admin/custom_fields/general.help_text')}}</th>
<th data-searchable="true">{{ trans('general.email') }}</th>
<th data-visible="false">{{ trans('admin/custom_fields/general.db_field') }}</th>
<th data-searchable="true">{{ trans('admin/custom_fields/general.field_format') }}</th>
<th data-searchable="true">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
<th data-searchable="true">{{ trans('admin/custom_fields/general.fieldsets') }}</th>
<th>Actions</th>
<th>{{ trans('button.actions') }}</th>
</tr>
</thead>
<tbody>
@ -145,7 +145,7 @@
<td>
<code>{{ $field->convertUnicodeDbSlug() }}</code>
@if ($field->convertUnicodeDbSlug()!=$field->db_column)
<br><i class="fas fa-exclamation-triangle text-danger"></i>WARNING. This field is in the custom fields table as <code>{{ $field->db_column }}</code> but should be <code>{{ $field->convertUnicodeDbSlug() }}</code>.
<br><i class="fas fa-exclamation-triangle text-danger"></i>{{!! trans('admin/custom_fields/general.db_convert_warning', array('db_column' => $field->db_column, 'expected' => $field->convertUnicodeDbSlug())) !!}}
@endif
</td>
<td>{{ $field->format }}</td>
@ -160,19 +160,19 @@
@can('update', $field)
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
<span class="sr-only">Edit</span>
<span class="sr-only">{{ trans('button.edit') }}</span>
</a>
@endcan
@endcan
@can('delete', $field)
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
@if($field->fieldset->count()>0)
<button type="submit" class="btn btn-danger btn-sm disabled" disabled>
<i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">Delete</span></button>
<span class="sr-only">{{ trans('button.delete') }}</span></button>
@else
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">Delete</span>
<span class="sr-only">{{ trans('button.delete') }}</span>
</button>
@endif
{{ Form::close() }}