From 73e780d7b67ad02ed10431261088a5be7584423c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20=C3=9Ar?= Date: Tue, 23 Mar 2021 02:41:32 +0100 Subject: [PATCH] [js_upload] Improve wording by adding placeholders --- js_upload/js_upload.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index d7c2575e..6a86575f 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -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()) {