Corrected some translations

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-08-16 12:39:59 +01:00
parent 90584ab803
commit 856c57cb12
12 changed files with 22 additions and 16 deletions

View file

@ -246,7 +246,7 @@ class PredefinedKitsController extends Controller
$relation = $kit->models();
if ($relation->find($model_id)) {
return response()->json(Helper::formatStandardApiResponse('error', null, ['model' => 'Model already attached to kit']));
return response()->json(Helper::formatStandardApiResponse('error', null, ['model' => trans('admin/kits/general.model_already_attached')]));
}
$relation->attach($model_id, ['quantity' => $quantity]);

View file

@ -62,10 +62,10 @@ class CheckoutKitController extends Controller
$checkout_result = $this->kitService->checkout($request, $kit, $user);
if (Arr::has($checkout_result, 'errors') && count($checkout_result['errors']) > 0) {
return redirect()->back()->with('error', trans('general.checkout_error'))->with('error_messages', $checkout_result['errors']);
return redirect()->back()->with('error', trans('admin/kits/general.checkout_error'))->with('error_messages', $checkout_result['errors']);
}
return redirect()->back()->with('success', trans('general.checkout_success'))
return redirect()->back()->with('success', trans('admin/kits/general.checkout_success'))
->with('assets', Arr::get($checkout_result, 'assets', null))
->with('accessories', Arr::get($checkout_result, 'accessories', null))
->with('consumables', Arr::get($checkout_result, 'consumables', null));

View file

@ -48,6 +48,7 @@ class Kernel extends HttpKernel
'api' => [
'auth:api',
\App\Http\Middleware\CheckLocale::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

View file

@ -86,7 +86,7 @@ class AssetsTransformer
'next_audit_date' => Helper::getFormattedDateObject($asset->next_audit_date, 'date'),
'deleted_at' => Helper::getFormattedDateObject($asset->deleted_at, 'datetime'),
'purchase_date' => Helper::getFormattedDateObject($asset->purchase_date, 'date'),
'age' => $asset->purchase_date ? $asset->purchase_date->diffForHumans() : '',
'age' => $asset->purchase_date ? $asset->purchase_date->locale(app()->getLocale())->diffForHumans() : '',
'last_checkout' => Helper::getFormattedDateObject($asset->last_checkout, 'datetime'),
'last_checkin' => Helper::getFormattedDateObject($asset->last_checkin, 'datetime'),
'expected_checkin' => Helper::getFormattedDateObject($asset->expected_checkin, 'date'),

View file

@ -47,4 +47,5 @@ return [
'kit_deleted' => 'Kit was successfully deleted',
'kit_model_updated' => 'Model was successfully updated',
'kit_model_detached' => 'Model was successfully detached',
'model_already_attached' => 'Model already attached to kit',
];

View file

@ -426,7 +426,7 @@ return [
'assets_by_status_type' => 'Assets by Status Type',
'pie_chart_type' => 'Dashboard Pie Chart Type',
'hello_name' => 'Hello, :name!',
'unaccepted_profile_warning' => 'You have :count items requiring acceptance. Click here to accept or decline them',
'unaccepted_profile_warning' => 'You have one item requiring acceptance. Click here to accept or decline it | You have :count items requiring acceptance. Click here to accept or decline them',
'start_date' => 'Start Date',
'end_date' => 'End Date',
'alt_uploaded_image_thumbnail' => 'Uploaded thumbnail',
@ -559,5 +559,6 @@ return [
'expires' => 'Expires',
'map_fields'=> 'Map :item_type Field',
'remaining_var' => ':count Remaining',
'assets_in_var' => 'Assets in :name :type',
];

View file

@ -17,7 +17,7 @@
<strong>
<a href="{{ route('account.accept') }}" style="color: white;">
{{ trans('general.unaccepted_profile_warning', array('count' => $acceptances)) }}
{{ trans_choice('general.unaccepted_profile_warning', $acceptances, ['count' => $acceptances]) }}
</a>
</strong>
</div>

View file

@ -3,8 +3,7 @@
{{-- Page title --}}
@section('title')
{{ $category->name }}
{{ ucwords($category_type_route) }}
{{ trans('general.assets_in_var', ['name'=> $category->name, 'type' => trans('general.category')]) }}
@parent
@stop

View file

@ -132,7 +132,7 @@
:button_label="trans('general.checkin')"
:disabled_select="!$asset->model"
:options="[
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'assets']),
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => trans('general.assets')]),
'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),
]"
/>

View file

@ -180,7 +180,7 @@
:button_label="trans('general.checkout')"
:disabled_select="!$asset->model"
:options="[
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'assets']),
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => trans('general.assets')]),
'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),
'target' => trans('admin/hardware/form.redirect_to_checked_out_to'),

View file

@ -2,7 +2,7 @@
{{-- Page title --}}
@section('title')
Attempted Logins
{{ trans('admin/settings/general.login') }}
@parent
@stop

View file

@ -373,7 +373,7 @@
</button>
</div>
<table style="margin-top: 80px;">
<table style="margin-top: 80px;" class="snipe-table">
<tr class="collapse" id="eula-row">
<td style="padding-right: 10px; vertical-align: top; font-weight: bold;">EULA</td>
<td style="padding-right: 10px; vertical-align: top; padding-bottom: 80px;" colspan="3">
@ -395,8 +395,8 @@
</tr>
<tr style="height: 80px;">
<td></td>
<td style="padding-right: 10px; vertical-align: top;">Name</td>
<td style="padding-right: 10px; vertical-align: top;">Signature</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.name') }}</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.signature') }}</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.date') }}</td>
</tr>
<tr>
@ -407,8 +407,8 @@
</tr>
<tr>
<td></td>
<td style="padding-right: 10px; vertical-align: top;">Name</td>
<td style="padding-right: 10px; vertical-align: top;">Signature</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.name') }}</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.signature') }}</td>
<td style="padding-right: 10px; vertical-align: top;">{{ trans('general.date') }}</td>
<td></td>
</tr>
@ -419,6 +419,10 @@
<script src="{{ url(mix('js/dist/all.js')) }}" nonce="{{ csrf_token() }}"></script>
<script src="{{ url(mix('js/dist/bootstrap-table.js')) }}"></script>
<script src="{{ url(mix('js/dist/bootstrap-table-locale-all.min.js')) }}"></script>
<!-- load english again here, even though it's in the all.js file, because if BS table doesn't have the translation, it otherwise defaults to chinese. See https://bootstrap-table.com/docs/api/table-options/#locale -->
<script src="{{ url(mix('js/dist/bootstrap-table-en-US.min.js')) }}"></script>
<script>
$('.snipe-table').bootstrapTable('destroy').each(function () {