Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected some translations #15318

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/PredefinedKitsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function storeModel(Request $request, $kit_id) : JsonResponse

$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]);

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Kits/CheckoutKitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public function store(Request $request, $kit_id)

$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));
Expand Down
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Kernel extends HttpKernel

'api' => [
'auth:api',
\App\Http\Middleware\CheckLocale::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Transformers/AssetsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function transformAsset(Asset $asset)
'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'),
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-US/admin/kits/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@
'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',
];
3 changes: 2 additions & 1 deletion resources/lang/en-US/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
'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',
Expand Down Expand Up @@ -559,5 +559,6 @@
'expires' => 'Expires',
'map_fields'=> 'Map :item_type Field',
'remaining_var' => ':count Remaining',
'assets_in_var' => 'Assets in :name :type',

];
2 changes: 1 addition & 1 deletion resources/views/account/view-assets.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 1 addition & 2 deletions resources/views/categories/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion resources/views/hardware/checkin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]),
]"
/>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/hardware/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

Expand Down
2 changes: 1 addition & 1 deletion resources/views/settings/logins.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Expand Down
14 changes: 9 additions & 5 deletions resources/views/users/print.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class="snipe-table table table-striped inventory"
</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">
Expand All @@ -395,8 +395,8 @@ class="snipe-table table table-striped inventory"
</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>
Expand All @@ -407,8 +407,8 @@ class="snipe-table table table-striped inventory"
</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>
Expand All @@ -419,6 +419,10 @@ class="snipe-table table table-striped inventory"
<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 () {
Expand Down
Loading