If non-english show message to change to english

This commit is contained in:
Hillel Coren 2018-02-14 14:33:05 +02:00
parent c9719b282b
commit 63b43b199f

View File

@ -105,6 +105,7 @@ class AccountController extends BaseController
public function getStarted()
{
$user = false;
$account = false;
$guestKey = Input::get('guest_key'); // local storage key to login until registered
if (Auth::check()) {
@ -131,6 +132,12 @@ class AccountController extends BaseController
Auth::login($user, true);
event(new UserSignedUp());
if ($account && $account->language_id != DEFAULT_LANGUAGE) {
$link = link_to('/invoices/create?lang=en', 'click here');
$message = sprintf('Your account language has been set automatically, %s to change to English', $link);
Session::flash('warning', $message);
}
$redirectTo = Input::get('redirect_to') ? SITE_URL . '/' . ltrim(Input::get('redirect_to'), '/') : 'invoices/create';
return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up'));
}