Skip to content

Commit

Permalink
translate error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Aug 26, 2023
1 parent 8f3342d commit ca23bb8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/ControlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public function doPlan(Request $request)
// Control already made ?
if ($control->realisation_date !== null) {
return back()
->withErrors(['msg' => 'Control already made'])
->withErrors(['msg' => trans('cruds.control.error.made')])
->withInput();
}

Expand All @@ -652,7 +652,7 @@ public function doPlan(Request $request)
->where('scope', '=', $request->scope)
->count() > 0) {
return back()
->withErrors(['msg' => 'Control duplicate'])
->withErrors(['msg' => trans('cruds.control.error.duplicate')])
->withInput();
}

Expand Down Expand Up @@ -680,7 +680,7 @@ public function make(Request $request)

// Control already made ?
if ($control->realisation_date !== null) {
return back()->withErrors(['msg' => 'Control already made']);
return back()->withErrors(['msg' => trans('cruds.control.error.made')]);
}

// get associated documents
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/MeasureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function activate(Request $request)
if ($control !== null) {
// control already exixts
return back()
->withErrors(['msg' => 'A control already exists for that scope'])
->withErrors(['msg' => trans('cruds.control.error.duplicate')])
->withInput();
}

Expand Down
4 changes: 4 additions & 0 deletions resources/lang/en/cruds.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
'input' => 'Input',
'owners' => 'Responsibles',
],
'error' => [
'made' => 'This control has already been made.',
'duplicate' => 'This control already exists.',
],
'checklist' => 'Measure sheet',
'list' => 'Measurement list',
'edit' => 'Edit security check',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/fr/cruds.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
'status_all' => 'Tous',
'owners' => 'Responsables',
],
'error' => [
'made' => 'Ce contrôle a déjà été réalisé.',
'duplicate' => 'Ce contrôle existe déjà.',
],
'checklist' => 'Fiche de contrôle',
'list' => 'Liste des contrôles',
'edit' => 'Modifier un contrôle de sécurité',
Expand Down

0 comments on commit ca23bb8

Please sign in to comment.