mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 02:50:39 +00:00
Added i18n support
This commit is contained in:
@@ -43,7 +43,7 @@ class AuthController extends Controller
|
||||
];
|
||||
|
||||
// Abort with 404, user not found
|
||||
return abort('404', 'We can\'t find a user with that e-mail address.');
|
||||
return abort('404', __('vuefilemanager.user_not_fount'));
|
||||
}
|
||||
/**
|
||||
* Login user
|
||||
|
||||
@@ -408,8 +408,10 @@ class FileManagerController extends Controller
|
||||
public function upload_item(Request $request)
|
||||
{
|
||||
// Check if user can upload
|
||||
if (config('vuefilemanager.limit_storage_by_capacity') && user_storage_percentage() >= 100)
|
||||
if (config('vuefilemanager.limit_storage_by_capacity') && user_storage_percentage() >= 100) {
|
||||
|
||||
abort(423, 'You exceed your storage limit!');
|
||||
}
|
||||
|
||||
// Validate request
|
||||
$validator = Validator::make($request->all(), [
|
||||
|
||||
@@ -33,7 +33,6 @@ class UserAccountController extends Controller
|
||||
'user' => $user->only(['name', 'email', 'avatar']),
|
||||
'favourites' => $user->favourites->makeHidden(['pivot']),
|
||||
'latest_uploads' => $user->latest_uploads->makeHidden(['user_id', 'basename']),
|
||||
|
||||
'storage' => [
|
||||
'used' => Metric::bytes($user->used_capacity)->format(),
|
||||
'capacity' => format_gigabytes(config('vuefilemanager.user_storage_capacity')),
|
||||
@@ -57,7 +56,7 @@ class UserAccountController extends Controller
|
||||
return [
|
||||
[
|
||||
'unique_id' => 0,
|
||||
'name' => 'Home',
|
||||
'name' => __('vuefilemanager.home'),
|
||||
'location' => 'base',
|
||||
'folders' => $folders,
|
||||
]
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ByteUnits\Metric;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
@@ -54,7 +55,6 @@ function check_directory($directory)
|
||||
*/
|
||||
function make_single_input($request)
|
||||
{
|
||||
|
||||
// Create container
|
||||
$data = [];
|
||||
|
||||
@@ -157,4 +157,18 @@ function filter_folders_ids($folders)
|
||||
$folder_unique_ids = recursiveFind($folders->toArray(), 'unique_id');
|
||||
|
||||
return appeared_once($folder_unique_ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format localized date
|
||||
*
|
||||
* @param $date
|
||||
* @param string $format
|
||||
* @return string
|
||||
*/
|
||||
function format_date($date, $format = '%d. %B. %Y, %H:%M')
|
||||
{
|
||||
$start = Carbon::parse($date);
|
||||
|
||||
return $start->formatLocalized($format);
|
||||
}
|
||||
Reference in New Issue
Block a user