Skip to content

Commit d4c383e

Browse files
committed
Translated internal notifications
1 parent 761ebe4 commit d4c383e

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

resources/lang/en/messages.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
'Reason:' => 'Reason:+',
128128

129129
'Close' => 'Close+',
130+
'Dismiss' => 'Dismiss+',
130131

131132
'All Notifications' => 'All Notifications+',
132133

@@ -546,7 +547,38 @@
546547
'Warn.Disable.Maintenance' => 'You are about to disable Maintenance Mode. Are you sure?+',
547548

548549

549-
'' => '+',
550+
/*
551+
|--------------------------------------------------------------------------
552+
| Notification messages
553+
|--------------------------------------------------------------------------
554+
|
555+
| All internal notifications.
556+
| resources/views/layouts/notifications.blade.php
557+
|
558+
*/
559+
560+
'No notifications' => 'No notifications+',
561+
562+
'Your security is at risk!' => 'Your security is at risk!+',
563+
'Immediate action is required!' => 'Immediate action is required!+',
564+
'Your security is at risk!' => 'Your security is at risk!+',
565+
'security.msg1' => 'Your security is at risk.+',
566+
'security.msg2' => 'Some files can be accessed by everyone. Immediate action is required!+',
567+
'security.msg3' => 'Some important files, are publicly accessible, putting your security at risk. Please take immediate action to revoke public access to these files to prevent unauthorized access to your sensitive information.+',
568+
'security.msg4' => 'Learn more+',
569+
570+
'Hide this notification' => 'Hide this notification+',
571+
'Help Us Out' => 'Help Us Out+',
572+
'Enjoying Linkstack?' => 'Enjoying Linkstack?+',
573+
'Support Linkstack' => 'Support Linkstack+',
574+
'support.msg1' => 'If you\'re enjoying using Linkstack, we would greatly appreciate it if you could take a moment to+',
575+
'support.msg2' => 'give our project a star on GitHub+',
576+
'support.msg3' => 'Your support will help us reach a wider audience and improve the quality of our project.+',
577+
'support.msg4' => 'If you\'re able to+',
578+
'support.msg5' => 'make a financial contribution</a>, even a small amount would help us cover the costs of maintaining and improving Linkstack.+',
579+
'support.msg6' => 'Thank you for your support and for being a part of the LinkStack community!+',
580+
550581

582+
'' => '+',
551583

552584
];

resources/views/layouts/notifications.blade.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
$GLOBALS['activenotify'] = true;
44
$compromised = false;
55
function notification($dismiss = '', $ntid, $heading, $body) {
6+
$closeMSG = __('messages.Close');
7+
$dismissMSG = __('messages.Dismiss');
68
$dismissBtn = '';
79
if ($dismiss) {
8-
$dismissBtn = '<a href="' . url()->current() . '?dismiss=' . $dismiss . '" class="btn btn-danger">Dismiss</a>';
10+
$dismissBtn = '<a href="' . url()->current() . '?dismiss=' . $dismiss . '" class="btn btn-danger">'.$dismissMSG.'</a>';
911
}
1012
echo <<<MODAL
1113
<div class="modal fade" id="$ntid" data-bs-backdrop="true" data-bs-keyboard="false" tabindex="-1" aria-labelledby="${ntid}-label" aria-hidden="true">
@@ -22,7 +24,7 @@ function notification($dismiss = '', $ntid, $heading, $body) {
2224
</div>
2325
<div class="modal-footer">
2426
$dismissBtn
25-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
27+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">$closeMSG</button>
2628
</div>
2729
</div>
2830
</div>
@@ -84,19 +86,19 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
8486
[
8587
'id' => 'modal-1',
8688
'icon' => 'bi bi-exclamation-triangle-fill text-danger',
87-
'title' => 'Your security is at risk!',
88-
'message' => 'Immediate action is required!',
89+
'title' => __('messages.Your security is at risk!'),
90+
'message' => __('messages.Immediate action is required!'),
8991
'condition' => $compromised,
90-
'dismiss' => 'Dismiss this notification',
92+
'dismiss' => '',
9193
'adminonly' => true,
9294
],
9395
[
9496
'id' => 'modal-star',
9597
'icon' => 'bi bi-heart-fill',
96-
'title' => 'Enjoying Linkstack?',
97-
'message' => 'Help Us Out',
98+
'title' => __('messages.Enjoying Linkstack?'),
99+
'message' => __('messages.Help Us Out'),
98100
'condition' => UserData::getData($notifyID, 'hide-star-notification') !== true,
99-
'dismiss' => 'Hide this notification',
101+
'dismiss' => __('messages.Hide this notification'),
100102
'adminonly' => true,
101103
],
102104
];
@@ -115,16 +117,16 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
115117
@else
116118
@php $GLOBALS['activenotify'] = false; @endphp
117119
@push('notifications')
118-
<center class='p-2'><i>No notifications</i></center>
120+
<center class='p-2'><i>{{__('messages.No notifications')}}</i></center>
119121
@endpush
120122
@endif
121123

122124

123125

124126
{{-- Notification Modals --}}
125127
@push('sidebar-scripts') @php
126-
notification('', 'modal-1', 'Your security is at risk!', '<b>Your security is at risk.</b> Some files can be accessed by everyone. Immediate action is required!<br><br>Some important files, are publicly accessible, putting your security at risk. Please take immediate action to revoke public access to these files to prevent unauthorized access to your sensitive information.<br><a href="'.url('admin/config#5').'">Learn more</a>.');
127-
notification('hide-star-notification', 'modal-star', 'Support Linkstack', 'If you\'re enjoying using Linkstack, we would greatly appreciate it if you could take a moment to <a target="_blank" href="https://github.com/linkstackorg/linkstack">give our project a star on GitHub</a>. Your support will help us reach a wider audience and improve the quality of our project.<br><br>If you\'re able to <a target="_blank" href="https://linkstack.org/donate">make a financial contribution</a>, even a small amount would help us cover the costs of maintaining and improving Linkstack.<br><br>Thank you for your support and for being a part of the LinkStack community!');
128+
notification('', 'modal-1', __('messages.Your security is at risk!'), '<b>'.__('messages.security.msg1').'</b> '.__('messages.security.msg2').'<br><br>'.__('messages.security.msg3').'<br><a href="'.url('admin/config#5').'">'.__('messages.security.msg3').'</a>.');
129+
notification('hide-star-notification', 'modal-star', __('messages.Support Linkstack'), ''.__('messages.support.msg1').' <a target="_blank" href="https://github.com/linkstackorg/linkstack">'.__('messages.support.msg2').'</a>. '.__('messages.support.msg3').'<br><br>'.__('messages.support.msg4').' <a target="_blank" href="https://linkstack.org/donate">'.__('messages.support.msg5').'<br><br>'.__('messages.support.msg6').'');
128130
@endphp @endpush
129131

130132
@php

0 commit comments

Comments
 (0)