Handled a few more hard-coded strings

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-03-21 23:56:07 -07:00
parent 473211397f
commit 545d023a18
4 changed files with 24 additions and 15 deletions

View file

@ -630,7 +630,7 @@ class AssetsController extends Controller
try { try {
$results = $csv->getRecords(); $results = $csv->getRecords();
} catch (\Exception $e) { } catch (\Exception $e) {
return back()->with('error', 'There was an error reading the CSV file: '.$e->getMessage()); return back()->with('error', trans('general.error_in_import_file', ['error' => $e->getMessage()]));
} }
$item = []; $item = [];
$status = []; $status = [];

View file

@ -35,7 +35,6 @@ return [
'superadmin_permission_warning' => 'Only superadmins may grant a user superadmin access.', 'superadmin_permission_warning' => 'Only superadmins may grant a user superadmin access.',
'admin_permission_warning' => 'Only users with admins rights or greater may grant a user admin access.', 'admin_permission_warning' => 'Only users with admins rights or greater may grant a user admin access.',
'remove_group_memberships' => 'Remove Group Memberships', 'remove_group_memberships' => 'Remove Group Memberships',
'warning_deletion' => 'WARNING:',
'warning_deletion_information' => 'You are about to checkin ALL items from the :count user(s) listed below. Super admin names are highlighted in red.', 'warning_deletion_information' => 'You are about to checkin ALL items from the :count user(s) listed below. Super admin names are highlighted in red.',
'update_user_assets_status' => 'Update all assets for these users to this status', 'update_user_assets_status' => 'Update all assets for these users to this status',
'checkin_user_properties' => 'Check in all properties associated with these users', 'checkin_user_properties' => 'Check in all properties associated with these users',

View file

@ -266,7 +266,6 @@ return [
'sure_to_delete' => 'Are you sure you wish to delete', 'sure_to_delete' => 'Are you sure you wish to delete',
'submit' => 'Submit', 'submit' => 'Submit',
'target' => 'Target', 'target' => 'Target',
'toggle_navigation' => 'Toogle Navigation',
'time_and_date_display' => 'Time and Date Display', 'time_and_date_display' => 'Time and Date Display',
'total_assets' => 'total assets', 'total_assets' => 'total assets',
'total_licenses' => 'total licenses', 'total_licenses' => 'total licenses',
@ -422,5 +421,16 @@ return [
'merged_log_this_user_into' => 'Merged this user (ID :to_id - :to_username) into user ID :from_id (:from_username) ', 'merged_log_this_user_into' => 'Merged this user (ID :to_id - :to_username) into user ID :from_id (:from_username) ',
'merged_log_this_user_from' => 'Merged user ID :from_id (:from_username) into this user (ID :to_id - :to_username)', 'merged_log_this_user_from' => 'Merged user ID :from_id (:from_username) into this user (ID :to_id - :to_username)',
'clear_and_save' => 'Clear & Save', 'clear_and_save' => 'Clear & Save',
'update_existing_values' => 'Update Existing Values?',
'send_welcome_email_to_users' => ' Send Welcome Email for new Users?',
'back_before_importing' => 'Backup before importing?',
'csv_header_field' => 'CSV Header Field',
'import_field' => 'Import Field',
'sample_value' => 'Sample Value',
'no_headers' => 'No Columns Found',
'error_in_import_file' => 'There was an error reading the CSV file: :error',
'percent_complete' => ':percent % Complete',
'errors_importing' => 'Some Errors occurred while importing: ',
'warning' => 'WARNING: :warning',
'success_redirecting' => '"Success... Redirecting.',
]; ];

View file

@ -24,7 +24,7 @@
<div class="box"> <div class="box">
<div class="box-body"> <div class="box-body">
<div class="alert alert-warning"> <div class="alert alert-warning">
<strong>Warning</strong> Some Errors occurred while importing {{-- TODO: hardcoded string --}} <strong><i class="fa fa-warning info" aria-hidden="true"></i> {{ trans('general.warning', ['warning'=> trans('general.errors_importing')]) }}</strong>
</div> </div>
<div class="errors-table"> <div class="errors-table">
@ -143,7 +143,7 @@
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="activeFile.import_type" class="col-md-3 col-xs-12 text-right"> <label for="activeFile.import_type" class="col-md-3 col-xs-12 text-right">
Import Type {{ trans('general.import_type') }}
</label> </label>
<div class="col-md-9 col-xs-12"> <div class="col-md-9 col-xs-12">
@ -162,21 +162,21 @@
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="update" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore> <label for="update" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="update" data-livewire-component="{{ $_instance->id }}"> <input type="checkbox" class="minimal livewire-icheck" name="update" data-livewire-component="{{ $_instance->id }}">
Update Existing Values? {{ trans('general.update_existing_values') }}
</label> </label>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="send_welcome" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore> <label for="send_welcome" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="send_welcome" data-livewire-component="{{ $_instance->id }}"> <input type="checkbox" class="minimal livewire-icheck" name="send_welcome" data-livewire-component="{{ $_instance->id }}">
Send Welcome Email for new Users? {{ trans('general.send_welcome_email_to_users') }}
</label> </label>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="run_backup" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore> <label for="run_backup" class="col-md-9 col-md-offset-3 col-xs-12" wire:ignore>
<input type="checkbox" class="minimal livewire-icheck" name="run_backup" data-livewire-component="{{ $_instance->id }}"> <input type="checkbox" class="minimal livewire-icheck" name="run_backup" data-livewire-component="{{ $_instance->id }}">
Backup before importing? {{ trans('general.back_before_importing') }}
</label> </label>
</div> </div>
@ -198,13 +198,13 @@
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3 text-right"> <div class="col-md-3 text-right">
<strong>CSV Header Field</strong> <strong>{{ trans('general.csv_header_field') }}</strong>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<strong>Import Field</strong> <strong>{{ trans('general.import_field') }}</strong>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<strong>Sample Value</strong> <strong>{{ trans('general.sample_value') }}</strong>
</div> </div>
</div><!-- /div row --> </div><!-- /div row -->
@ -234,7 +234,7 @@
</div><!-- /div row --> </div><!-- /div row -->
@endforeach @endforeach
@else @else
No Columns Found! {{ trans('general.no_headers') }}
@endif @endif
<div class="form-group col-md-12"> <div class="form-group col-md-12">
@ -299,7 +299,7 @@
}, },
progress: function(e, data) { progress: function(e, data) {
@this.progress = parseInt((data.loaded / data.total * 100, 10)); @this.progress = parseInt((data.loaded / data.total * 100, 10));
@this.progress_message = @this.progress+'% Complete'; // TODO - this should come from server (so it can be internationalized) @this.progress_message = @this.progress+'% Complete'; // TODO - make this use general.percent_complete as a translation, passing :percent as a variable
}, },
fail: function(e, data) { fail: function(e, data) {
@this.progress_bar_class = "progress-bar-danger"; @this.progress_bar_class = "progress-bar-danger";
@ -353,7 +353,7 @@
}).done( function (body) { }).done( function (body) {
// Success // Success
@this.statusType="success"; @this.statusType="success";
@this.statusText = "Success... Redirecting."; @this.statusText = {{ trans('general.success_redirecting') }};
// console.dir(body) // console.dir(body)
window.location.href = body.messages.redirect_url; window.location.href = body.messages.redirect_url;
}).fail( function (jqXHR, textStatus, error) { }).fail( function (jqXHR, textStatus, error) {