Skip to content

Commit 13cc4ba

Browse files
committed
update language files
1 parent 5f474e5 commit 13cc4ba

File tree

10 files changed

+49
-28
lines changed

10 files changed

+49
-28
lines changed

app/Http/Controllers/ProfilesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function deleteUserAccount(Request $request, $id)
365365

366366
if ($user->id != $currentUser->id) {
367367

368-
return redirect('profile/'.$user->name.'/edit')->with('error', 'You can only delete your own profile.');
368+
return redirect('profile/'.$user->name.'/edit')->with('error', trans('profile.errorDeleteNotYour'));
369369

370370
}
371371

@@ -395,7 +395,7 @@ public function deleteUserAccount(Request $request, $id)
395395
$request->session()->flush();
396396
$request->session()->regenerate();
397397

398-
return redirect('/login/')->with('success', 'Your account has been deleted.');
398+
return redirect('/login/')->with('success', trans('profile.successUserAccountDeleted'));
399399

400400
}
401401

app/Http/Controllers/RestoreUserController.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ public function __construct()
2323
$this->middleware('web');
2424
}
2525

26+
/**
27+
* User Account Restore
28+
*
29+
* @param \Illuminate\Http\Request $request
30+
* @param string $token
31+
* @return \Illuminate\Http\Response
32+
*/
2633
public function userReActivate(Request $request, $token)
2734
{
2835

@@ -35,7 +42,7 @@ public function userReActivate(Request $request, $token)
3542
$level4 = openssl_decrypt($level5, $encrypter, $restoreKey);
3643
$level3 = base64_decode($level4);
3744
$level2 = urldecode($level3);
38-
$level1[] = explode($sepKey, $level2);
45+
$level1[] = explode($sepKey, $level2);
3946
$uuid = $level1[0][0];
4047
$userId = $level1[0][1] / $userIdKey;
4148
$user = SoftDeletesController::getDeletedUser($userId);
@@ -51,13 +58,13 @@ public function userReActivate(Request $request, $token)
5158

5259
if ($daysDeleted >= $cutoffDays) {
5360

54-
return redirect('/login')->with('error', 'Sorry, account cannot be restored');
61+
return redirect('/login')->with('error', trans('profile.errorRestoreUserTime'));
5562

5663
}
5764

5865
$user->restore();
5966

60-
return redirect('/login')->with('success', 'Welcome back ' . $user->name . '! Account Successfully Restored');
67+
return redirect('/login')->with('success', trans('profile.successUserRestore',['username' => $user->name]));
6168

6269
}
6370

app/Http/Controllers/SoftDeletesController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function getDeletedUser($id)
3333
{
3434
$user = User::onlyTrashed()->where('id', $id)->get();
3535
if (count($user) != 1) {
36-
return redirect('/users/deleted/')->with('error', 'User not found.');
36+
return redirect('/users/deleted/')->with('error', trans('usersmanagement.errorUserNotFound'));
3737
}
3838
return $user[0];
3939
}
@@ -73,7 +73,7 @@ public function update(Request $request, $id)
7373
{
7474
$user = self::getDeletedUser($id);
7575
$user->restore();
76-
return redirect('/users/')->with('success', 'User successfully restored.');
76+
return redirect('/users/')->with('success', trans('usersmanagement.successRestore'));
7777
}
7878

7979
/**
@@ -86,7 +86,7 @@ public function destroy($id)
8686
{
8787
$user = self::getDeletedUser($id);
8888
$user->forceDelete();
89-
return redirect('/users/deleted/')->with('success', 'User record successfully destroyed.');
89+
return redirect('/users/deleted/')->with('success', trans('usersmanagement.successDestroy'));
9090
}
9191

9292
}

app/Notifications/SendActivationEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function toMail($notifiable)
4747

4848
$message = new MailMessage;
4949
$message->subject(trans('emails.activationSubject'))
50-
->greeting(trans('emails.activationGreeting'))
50+
->greeting(trans('emails.activationGreeting',['username' => \Auth::User()->name]))
5151
->line(trans('emails.activationMessage'))
5252
->action(trans('emails.activationButton'), route('authenticated.activate', ['token' => $this->token]))
5353
->line(trans('emails.activationThanks'));

app/Notifications/SendGoodbyeEmail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function toMail($notifiable)
4444

4545
$message = new MailMessage;
4646
$message->subject(trans('emails.goodbyeSubject'))
47-
->greeting(trans('emails.goodbyeGreeting'))
47+
->greeting(trans('emails.goodbyeGreeting',['username' => \Auth::User()->name]))
4848
->line(trans('emails.goodbyeMessage'))
4949
->action(trans('emails.goodbyeButton'), route('user.reactivate', ['token' => $this->token]))
5050
->line(trans('emails.goodbyeThanks'));

database/seeds/UsersTableSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function run()
2525
$userRole = Role::whereName('User')->first();
2626

2727
// Seed test admin
28-
$seededAdminEmail = 'jeremykenedy@gmail.com';
28+
$seededAdminEmail = 'admin@admin.com';
2929
$user = User::where('email', '=', $seededAdminEmail)->first();
3030
if ($user === null) {
3131
$user = User::create(array(

resources/lang/en/emails.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*
1919
*/
2020

21-
'activationSubject' => 'Activation email',
22-
'activationGreeting' => 'Hello!',
21+
'activationSubject' => 'Activation required',
22+
'activationGreeting' => 'Welcome :username!',
2323
'activationMessage' => 'You need to activate your email before you can start using all of our services.',
2424
'activationButton' => 'Activate',
2525
'activationThanks' => 'Thank you for using our application!',
@@ -29,8 +29,8 @@
2929
*
3030
*/
3131
'goodbyeSubject' => 'Sorry to see you go...',
32-
'goodbyeGreeting' => 'Hello,',
33-
'goodbyeMessage' => 'We are very sorry to see you go. We wanted to let you know that your account has been deleted. Thank for the time we shared. You have ' . config('settings.restoreUserCutoff') . ' to restore your account.',
32+
'goodbyeGreeting' => 'Hello :username,',
33+
'goodbyeMessage' => 'We are very sorry to see you go. We wanted to let you know that your account has been deleted. Thank for the time we shared. You have ' . config('settings.restoreUserCutoff') . ' days to restore your account.',
3434
'goodbyeButton' => 'Restore Account',
3535
'goodbyeThanks' => 'We hope to see you again!',
3636

resources/lang/en/profile.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,17 @@
7474
'deleteAccountConfirmMsg' => 'Are you sure you want to delete your account?',
7575
'confirmDeleteRequired' => 'Confirm Account Deletion is required',
7676

77+
'errorDeleteNotYour' => 'You can only delete your own profile',
78+
'successUserAccountDeleted' => 'Your account has been deleted',
79+
'' => '',
80+
7781
// Messages
7882
'updateSuccess' => 'Your profile has been successfully updated',
7983
'submitButton' => 'Save Changes',
8084

85+
// Restore User Account
86+
'errorRestoreUserTime' => 'Sorry, account cannot be restored',
87+
'successUserRestore' => 'Welcome back :username! Account Successfully Restored'
88+
89+
8190
];

resources/lang/en/usersmanagement.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
'usersDeletedPanelTitle' => 'Deleted User Information',
3636
'usersBackDelBtn' => 'Back to Deleted Users',
3737

38+
39+
'successRestore' => 'User successfully restored.',
40+
'successDestroy' => 'User record successfully destroyed.',
41+
'errorUserNotFound' => 'User not found.',
42+
3843
];

resources/views/profiles/show.blade.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="panel panel-default">
2222
<div class="panel-heading">
2323

24-
{{ Lang::get('profile.showProfileTitle',['username' => $user->name]) }}
24+
{{ trans('profile.showProfileTitle',['username' => $user->name]) }}
2525

2626
</div>
2727
<div class="panel-body">
@@ -31,30 +31,30 @@
3131
<dl class="user-info">
3232

3333
<dt>
34-
{{ Lang::get('profile.showProfileUsername') }}
34+
{{ trans('profile.showProfileUsername') }}
3535
</dt>
3636
<dd>
3737
{{ $user->name }}
3838
</dd>
3939

4040
<dt>
41-
{{ Lang::get('profile.showProfileFirstName') }}
41+
{{ trans('profile.showProfileFirstName') }}
4242
</dt>
4343
<dd>
4444
{{ $user->first_name }}
4545
</dd>
4646

4747
@if ($user->last_name)
4848
<dt>
49-
{{ Lang::get('profile.showProfileLastName') }}
49+
{{ trans('profile.showProfileLastName') }}
5050
</dt>
5151
<dd>
5252
{{ $user->last_name }}
5353
</dd>
5454
@endif
5555

5656
<dt>
57-
{{ Lang::get('profile.showProfileEmail') }}
57+
{{ trans('profile.showProfileEmail') }}
5858
</dt>
5959
<dd>
6060
{{ $user->email }}
@@ -64,7 +64,7 @@
6464

6565
@if ($user->profile->theme_id)
6666
<dt>
67-
{{ Lang::get('profile.showProfileTheme') }}
67+
{{ trans('profile.showProfileTheme') }}
6868
</dt>
6969
<dd>
7070
{{ $currentTheme->name }}
@@ -73,7 +73,7 @@
7373

7474
@if ($user->profile->location)
7575
<dt>
76-
{{ Lang::get('profile.showProfileLocation') }}
76+
{{ trans('profile.showProfileLocation') }}
7777
</dt>
7878
<dd>
7979
{{ $user->profile->location }} <br />
@@ -86,7 +86,7 @@
8686

8787
@if ($user->profile->bio)
8888
<dt>
89-
{{ Lang::get('profile.showProfileBio') }}
89+
{{ trans('profile.showProfileBio') }}
9090
</dt>
9191
<dd>
9292
{{ $user->profile->bio }}
@@ -95,7 +95,7 @@
9595

9696
@if ($user->profile->twitter_username)
9797
<dt>
98-
{{ Lang::get('profile.showProfileTwitterUsername') }}
98+
{{ trans('profile.showProfileTwitterUsername') }}
9999
</dt>
100100
<dd>
101101
{!! HTML::link('https://twitter.com/'.$user->profile->twitter_username, $user->profile->twitter_username, array('class' => 'twitter-link', 'target' => '_blank')) !!}
@@ -104,7 +104,7 @@
104104

105105
@if ($user->profile->github_username)
106106
<dt>
107-
{{ Lang::get('profile.showProfileGitHubUsername') }}
107+
{{ trans('profile.showProfileGitHubUsername') }}
108108
</dt>
109109
<dd>
110110
{!! HTML::link('https://github.com/'.$user->profile->github_username, $user->profile->github_username, array('class' => 'github-link', 'target' => '_blank')) !!}
@@ -117,13 +117,13 @@
117117
@if ($user->profile)
118118
@if (Auth::user()->id == $user->id)
119119

120-
{!! HTML::icon_link(URL::to('/profile/'.Auth::user()->name.'/edit'), 'fa fa-fw fa-cog', Lang::get('titles.editProfile'), array('class' => 'btn btn-small btn-info btn-block')) !!}
120+
{!! HTML::icon_link(URL::to('/profile/'.Auth::user()->name.'/edit'), 'fa fa-fw fa-cog', trans('titles.editProfile'), array('class' => 'btn btn-small btn-info btn-block')) !!}
121121

122122
@endif
123123
@else
124124

125-
<p>{{ Lang::get('profile.noProfileYet') }}</p>
126-
{!! HTML::icon_link(URL::to('/profile/'.Auth::user()->name.'/edit'), 'fa fa-fw fa-plus ', Lang::get('titles.createProfile'), array('class' => 'btn btn-small btn-info btn-block')) !!}
125+
<p>{{ trans('profile.noProfileYet') }}</p>
126+
{!! HTML::icon_link(URL::to('/profile/'.Auth::user()->name.'/edit'), 'fa fa-fw fa-plus ', trans('titles.createProfile'), array('class' => 'btn btn-small btn-info btn-block')) !!}
127127

128128
@endif
129129

0 commit comments

Comments
 (0)