Errors are all translated. Closes #364.
This commit is contained in:
@@ -57,7 +57,7 @@ class AuthController extends Controller
|
||||
|
||||
return Redirect::back()
|
||||
->withInput(Binput::except('password'))
|
||||
->with('error', 'Invalid email or password');
|
||||
->with('error', trans('forms.login.invalid'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,11 +94,11 @@ class AuthController extends Controller
|
||||
// Failed login, log back out.
|
||||
Auth::logout();
|
||||
|
||||
return Redirect::route('login')->with('error', 'Invalid token');
|
||||
return Redirect::route('login')->with('error', trans('forms.login.invalid-token'));
|
||||
}
|
||||
}
|
||||
|
||||
return Redirect::route('login')->with('error', 'Invalid token');
|
||||
return Redirect::route('login')->with('error', trans('forms.login.invalid-token'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ class DashAPIController extends Controller
|
||||
public function postUpdateComponent(Component $component)
|
||||
{
|
||||
if (!$component->update(Binput::except(['_token']))) {
|
||||
throw new Exception('Failed to update the component.');
|
||||
throw new Exception(trans('dashboard.components.edit.failure'));
|
||||
}
|
||||
|
||||
return $component;
|
||||
|
||||
@@ -169,7 +169,7 @@ class DashSettingsController extends Controller
|
||||
$maxSize = $file->getMaxFilesize();
|
||||
|
||||
if ($file->getSize() > $maxSize) {
|
||||
return Redirect::back()->withErrors("You need to upload an image that is less than $maxSize.");
|
||||
return Redirect::back()->withErrors(trans('dashboard.settings.app-setup.too-big', ['size' => $maxSize]));
|
||||
}
|
||||
|
||||
if (!$file->isValid() || $file->getError()) {
|
||||
@@ -177,7 +177,7 @@ class DashSettingsController extends Controller
|
||||
}
|
||||
|
||||
if (strpos($file->getMimeType(), 'image/') !== 0) {
|
||||
return Redirect::back()->withErrors('Only images may be uploaded.');
|
||||
return Redirect::back()->withErrors(trans('dashboard.settings.app-setup.images-only'));
|
||||
}
|
||||
|
||||
// Store the banner.
|
||||
|
||||
Reference in New Issue
Block a user