]> git.mxchange.org Git - friendica-addons.git/blobdiff - js_upload/js_upload.php
IT translation update blackout addon THX Sylke Vicious
[friendica-addons.git] / js_upload / js_upload.php
index 20012a976729de5a2f23593d08316cd62b5811b0..6a86575fe8e9a8ec7649d08b274ed1400329bdae 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Name: JS Uploader
- * Description: JavaScript photo/image uploader. Uses Valum 'qq' Uploader.
+ * Description: JavaScript photo/image uploader. Helpful for uploading multiple files at once. Uses Valum 'qq' Uploader.
  * Version: 1.1
  * Author: Chris Case <http://friendika.openmindspace.org/profile/chris_case>
  * Maintainer: Hypolite Petovan <https://friendica.mrpetovan.com/profile/hypolite>
@@ -12,6 +12,7 @@ use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\DI;
+use Friendica\Util\Strings;
 
 function js_upload_install()
 {
@@ -229,8 +230,7 @@ class qqFileUploader
                $maximagesize = DI::config()->get('system', 'maximagesize');
 
                if (($maximagesize) && ($size > $maximagesize)) {
-                       return ['error' => DI::l10n()->t('Image exceeds size limit of ') . $maximagesize];
-
+                       return ['error' => DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))];
                }
 
                $pathinfo = pathinfo($this->file->getName());
@@ -242,8 +242,7 @@ class qqFileUploader
                $ext = $pathinfo['extension'] ?? '';
 
                if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) {
-                       $these = implode(', ', $this->allowedExtensions);
-                       return ['error' => DI::l10n()->t('File has an invalid extension, it should be one of ') . $these . '.'];
+                       return ['error' => DI::l10n()->t('File has an invalid extension, it should be one of %s.', implode(', ', $this->allowedExtensions))];
                }
 
                if ($this->file->save()) {