diff --git a/app/FileManagerFile.php b/app/FileManagerFile.php
index ffdf9954..022c3047 100644
--- a/app/FileManagerFile.php
+++ b/app/FileManagerFile.php
@@ -31,7 +31,7 @@ class FileManagerFile extends Model
*/
public function getCreatedAtAttribute()
{
- return Carbon::create($this->attributes['created_at'])->format('j M Y \a\t H:i');;
+ return format_date($this->attributes['created_at'], __('vuefilemanager.time'));
}
/**
@@ -43,7 +43,7 @@ class FileManagerFile extends Model
{
if (! $this->attributes['deleted_at']) return null;
- return Carbon::create($this->attributes['deleted_at'])->format('j M Y at H:i');
+ return format_date($this->attributes['deleted_at'], __('vuefilemanager.time'));
}
/**
diff --git a/app/FileManagerFolder.php b/app/FileManagerFolder.php
index ab6954cb..0a7fa78c 100644
--- a/app/FileManagerFolder.php
+++ b/app/FileManagerFolder.php
@@ -79,7 +79,7 @@ class FileManagerFolder extends Model
*/
public function getCreatedAtAttribute()
{
- return Carbon::create($this->attributes['created_at'])->format('j M Y \a\t H:i');
+ return format_date($this->attributes['created_at'], __('vuefilemanager.time'));
}
/**
@@ -91,7 +91,7 @@ class FileManagerFolder extends Model
{
if (! $this->attributes['deleted_at']) return null;
- return Carbon::create($this->attributes['deleted_at'])->format('j M Y \a\t H:i');
+ return format_date($this->attributes['deleted_at'], __('vuefilemanager.time'));
}
/**
diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php
index 4cab3791..98e6147a 100644
--- a/app/Http/Controllers/Auth/AuthController.php
+++ b/app/Http/Controllers/Auth/AuthController.php
@@ -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
diff --git a/app/Http/Controllers/FileManagerController.php b/app/Http/Controllers/FileManagerController.php
index e9144ced..350f593d 100644
--- a/app/Http/Controllers/FileManagerController.php
+++ b/app/Http/Controllers/FileManagerController.php
@@ -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(), [
diff --git a/app/Http/Controllers/UserAccountController.php b/app/Http/Controllers/UserAccountController.php
index f3e3e0de..d0c75f81 100644
--- a/app/Http/Controllers/UserAccountController.php
+++ b/app/Http/Controllers/UserAccountController.php
@@ -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,
]
diff --git a/app/Http/helpers.php b/app/Http/helpers.php
index 989aa7e0..1435702a 100644
--- a/app/Http/helpers.php
+++ b/app/Http/helpers.php
@@ -1,6 +1,7 @@
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);
}
\ No newline at end of file
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index ee8ca5bc..bf6e052e 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -2,6 +2,8 @@
namespace App\Providers;
+use Illuminate\Support\Facades\App;
+use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@@ -23,6 +25,11 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
- //
+ Schema::defaultStringLength(191);
+
+ $get_time_locale = App::getLocale() . '_' . mb_strtoupper(App::getLocale());
+
+ // Set locale for carbon dates
+ setlocale(LC_TIME, $get_time_locale);
}
}
diff --git a/config/app.php b/config/app.php
index 590f3253..1a2dc4c8 100644
--- a/config/app.php
+++ b/config/app.php
@@ -80,7 +80,7 @@ return [
|
*/
- 'locale' => 'en',
+ 'locale' => 'sk',
/*
|--------------------------------------------------------------------------
diff --git a/database/vue-file-manager-127.0.0.114-03-2020 b/database/vue-file-manager-127.0.0.114-03-2020
index 4474b73f..2b1248af 100644
--- a/database/vue-file-manager-127.0.0.114-03-2020
+++ b/database/vue-file-manager-127.0.0.114-03-2020
@@ -100,7 +100,7 @@ DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -137,7 +137,7 @@ CREATE TABLE `oauth_access_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`client_id` bigint(20) unsigned NOT NULL,
- `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+ `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`scopes` text COLLATE utf8mb4_unicode_ci,
`revoked` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
@@ -175,7 +175,7 @@ DROP TABLE IF EXISTS `oauth_clients`;
CREATE TABLE `oauth_clients` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned DEFAULT NULL,
- `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
`personal_access_client` tinyint(1) NOT NULL,
@@ -234,8 +234,8 @@ CREATE TABLE `oauth_refresh_tokens` (
DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE `password_resets` (
- `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
- `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -249,11 +249,11 @@ DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
- `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
- `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
- `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+ `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
+ `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
diff --git a/package-lock.json b/package-lock.json
index 322fd3b6..345d98da 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10216,6 +10216,11 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
+ "vue-i18n": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.16.0.tgz",
+ "integrity": "sha512-cp9JOsx4ETzlCsnD22FE8ZhAmD8kcyNLRKV0DPsS7bBNTCdIlOKuyTGonWKYcGCUtNMtwemDWRBevRm8eevBVg=="
+ },
"vue-loader": {
"version": "15.9.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.0.tgz",
diff --git a/package.json b/package.json
index 9d7f2c79..9b60e6a4 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"node-sass": "^4.13.1",
"vee-validate": "^3.2.5",
"vue": "^2.6.10",
+ "vue-i18n": "^8.16.0",
"vuex": "^3.0.1"
}
}
diff --git a/public/mix-manifest.json b/public/mix-manifest.json
index 84307b4c..189353f3 100644
--- a/public/mix-manifest.json
+++ b/public/mix-manifest.json
@@ -1,4 +1,40 @@
{
"/js/main.js": "/js/main.js",
- "/css/app.css": "/css/app.css"
+ "/css/app.css": "/css/app.css",
+ "/js/main.b199e742764976d477eb.hot-update.js": "/js/main.b199e742764976d477eb.hot-update.js",
+ "/js/main.74bd4021acf8f5e6f2c0.hot-update.js": "/js/main.74bd4021acf8f5e6f2c0.hot-update.js",
+ "/js/main.7751cc56f809bdcca52f.hot-update.js": "/js/main.7751cc56f809bdcca52f.hot-update.js",
+ "/js/main.6550285a609d98fd0a2c.hot-update.js": "/js/main.6550285a609d98fd0a2c.hot-update.js",
+ "/js/main.593b8d94aebec435eaa6.hot-update.js": "/js/main.593b8d94aebec435eaa6.hot-update.js",
+ "/js/main.9646136421cb914b9bc8.hot-update.js": "/js/main.9646136421cb914b9bc8.hot-update.js",
+ "/js/main.34d97ba06940b269e518.hot-update.js": "/js/main.34d97ba06940b269e518.hot-update.js",
+ "/js/main.93f2bdf89f84cfacf4f3.hot-update.js": "/js/main.93f2bdf89f84cfacf4f3.hot-update.js",
+ "/js/main.817de8c8f5fd813c607b.hot-update.js": "/js/main.817de8c8f5fd813c607b.hot-update.js",
+ "/js/main.963bfdadae1fb90e0238.hot-update.js": "/js/main.963bfdadae1fb90e0238.hot-update.js",
+ "/js/main.1512db5a6a7632fb9e8e.hot-update.js": "/js/main.1512db5a6a7632fb9e8e.hot-update.js",
+ "/js/main.3a19340ddc14dcc839a1.hot-update.js": "/js/main.3a19340ddc14dcc839a1.hot-update.js",
+ "/js/main.397553844e2b0ca23cc7.hot-update.js": "/js/main.397553844e2b0ca23cc7.hot-update.js",
+ "/js/main.c87eeede975b87bf2b16.hot-update.js": "/js/main.c87eeede975b87bf2b16.hot-update.js",
+ "/js/main.f580b09761154926899f.hot-update.js": "/js/main.f580b09761154926899f.hot-update.js",
+ "/js/main.91d490a5132517514bfb.hot-update.js": "/js/main.91d490a5132517514bfb.hot-update.js",
+ "/js/main.bdad4fbdd1e409eb4b21.hot-update.js": "/js/main.bdad4fbdd1e409eb4b21.hot-update.js",
+ "/js/main.48d106f956e2b5fecbb0.hot-update.js": "/js/main.48d106f956e2b5fecbb0.hot-update.js",
+ "/js/main.3f7d1e2b874ad885f9ba.hot-update.js": "/js/main.3f7d1e2b874ad885f9ba.hot-update.js",
+ "/js/main.be94f32edd036852aa82.hot-update.js": "/js/main.be94f32edd036852aa82.hot-update.js",
+ "/js/main.0b838845dace73e0df6d.hot-update.js": "/js/main.0b838845dace73e0df6d.hot-update.js",
+ "/js/main.aac07313ac3ce9a2e597.hot-update.js": "/js/main.aac07313ac3ce9a2e597.hot-update.js",
+ "/js/main.37168073afe720eff29e.hot-update.js": "/js/main.37168073afe720eff29e.hot-update.js",
+ "/js/main.1eafca2af4cbb4242c1f.hot-update.js": "/js/main.1eafca2af4cbb4242c1f.hot-update.js",
+ "/js/main.8f3db6ec42d42fa7152e.hot-update.js": "/js/main.8f3db6ec42d42fa7152e.hot-update.js",
+ "/js/main.3d0c0e744120bafa0076.hot-update.js": "/js/main.3d0c0e744120bafa0076.hot-update.js",
+ "/js/main.5bf20eacf51dd037796e.hot-update.js": "/js/main.5bf20eacf51dd037796e.hot-update.js",
+ "/js/main.bf91b39fc6ebda933d92.hot-update.js": "/js/main.bf91b39fc6ebda933d92.hot-update.js",
+ "/js/main.87b79f2adeaf95ca1eae.hot-update.js": "/js/main.87b79f2adeaf95ca1eae.hot-update.js",
+ "/js/main.caeb9ea0fe68c0e20cbc.hot-update.js": "/js/main.caeb9ea0fe68c0e20cbc.hot-update.js",
+ "/js/main.61e2b39b769cf182b833.hot-update.js": "/js/main.61e2b39b769cf182b833.hot-update.js",
+ "/js/main.ac3b225c09da944dd637.hot-update.js": "/js/main.ac3b225c09da944dd637.hot-update.js",
+ "/js/main.e90426301ffd1febd2e8.hot-update.js": "/js/main.e90426301ffd1febd2e8.hot-update.js",
+ "/js/main.ee9680aa2ebf66f438e2.hot-update.js": "/js/main.ee9680aa2ebf66f438e2.hot-update.js",
+ "/js/main.0af6eb46c23ed68de4db.hot-update.js": "/js/main.0af6eb46c23ed68de4db.hot-update.js",
+ "/js/main.7d6e0c7874e39ca5797d.hot-update.js": "/js/main.7d6e0c7874e39ca5797d.hot-update.js"
}
diff --git a/resources/js/components/VueFileManagerComponents/Auth.vue b/resources/js/components/VueFileManagerComponents/Auth.vue
index 0c3eef72..8ab3e26b 100644
--- a/resources/js/components/VueFileManagerComponents/Auth.vue
+++ b/resources/js/components/VueFileManagerComponents/Auth.vue
@@ -4,23 +4,23 @@
-
Welcome Back!
- Please type your email to log in:
+ {{ $t('page_login.title') }}
+ {{ $t('page_login.subtitle') }}