mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
email localization fix
This commit is contained in:
@@ -75,15 +75,15 @@ class AppServiceProvider extends ServiceProvider
|
||||
private function setLocale(): void
|
||||
{
|
||||
try {
|
||||
$app_locale = get_settings('language') ?? 'en';
|
||||
$appLocale = get_settings('language') ?? 'en';
|
||||
} catch (\PDOException $e) {
|
||||
$app_locale = 'en';
|
||||
$appLocale = 'en';
|
||||
}
|
||||
|
||||
// Set locale for application
|
||||
app()->setLocale($app_locale);
|
||||
app()->setLocale($appLocale);
|
||||
|
||||
// Set locale for carbon dates
|
||||
setlocale(LC_TIME, $app_locale . '_' . mb_strtoupper($app_locale));
|
||||
setlocale(LC_TIME, $appLocale . '_' . mb_strtoupper($appLocale));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,11 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
return UserFactory::new();
|
||||
}
|
||||
|
||||
public function preferredLocale(): string
|
||||
{
|
||||
return get_settings('language') ?? 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user used storage details
|
||||
*/
|
||||
|
||||
@@ -19,25 +19,27 @@ class UpdateSettingValueController extends Controller
|
||||
'message' => 'The value was successfully updated',
|
||||
];
|
||||
|
||||
$inputName = $request->input('name');
|
||||
|
||||
// Abort in demo mode
|
||||
if (is_demo()) {
|
||||
return response()->json($message);
|
||||
}
|
||||
|
||||
// Store image if exist
|
||||
if ($request->hasFile($request->input('name'))) {
|
||||
if ($request->hasFile($inputName)) {
|
||||
// Find and update image path
|
||||
Setting::updateOrCreate([
|
||||
'name' => $request->input('name'),
|
||||
'name' => $inputName,
|
||||
], [
|
||||
'value' => store_system_image($request, $request->input('name')),
|
||||
'value' => store_system_image($request, $inputName),
|
||||
]);
|
||||
|
||||
return response()->json($message);
|
||||
}
|
||||
|
||||
// Set paypal live option
|
||||
if ($request->input('name') === 'paypal_live') {
|
||||
if ($inputName === 'paypal_live') {
|
||||
setEnvironmentValue([
|
||||
'PAYPAL_IS_LIVE' => $request->input('value') ? 'true' : 'false',
|
||||
]);
|
||||
@@ -51,9 +53,14 @@ class UpdateSettingValueController extends Controller
|
||||
return response()->json($message);
|
||||
}
|
||||
|
||||
// Clear language cache
|
||||
if ($inputName === 'language') {
|
||||
cache()->forget('language');
|
||||
}
|
||||
|
||||
// Find and update variable
|
||||
Setting::updateOrCreate(
|
||||
['name' => $request->input('name')],
|
||||
['name' => $inputName],
|
||||
['value' => $request->input('value')]
|
||||
);
|
||||
|
||||
|
||||
@@ -15,9 +15,14 @@ class SendViaEmailAction
|
||||
string $token,
|
||||
User $user,
|
||||
): void {
|
||||
// Get default app locale
|
||||
$appLocale = get_settings('language') ?? 'en';
|
||||
|
||||
foreach ($emails as $email) {
|
||||
Notification::route('mail', $email)
|
||||
->notify(new SharedSendViaEmail($token, $user));
|
||||
->notify(
|
||||
(new SharedSendViaEmail($token, $user))->locale($appLocale)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,13 @@ class InviteMembersIntoTeamFolderAction
|
||||
|
||||
// Invite guest
|
||||
if (! $user) {
|
||||
// Get default app locale
|
||||
$appLocale = get_settings('language') ?? 'en';
|
||||
|
||||
Notification::route('mail', $member['email'])
|
||||
->notify(new InvitationIntoTeamFolder($folder, $invitation));
|
||||
->notify(
|
||||
(new InvitationIntoTeamFolder($folder, $invitation))->locale($appLocale)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,8 +44,13 @@ class CreateUploadRequestController extends Controller
|
||||
if ($user) {
|
||||
$user->notify(new UploadRequestNotification($uploadRequest));
|
||||
} else {
|
||||
// Get default app locale
|
||||
$appLocale = get_settings('language') ?? 'en';
|
||||
|
||||
Notification::route('mail', $uploadRequest->email)
|
||||
->notify(new UploadRequestNotification($uploadRequest));
|
||||
->notify(
|
||||
(new UploadRequestNotification($uploadRequest))->locale($appLocale)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user