diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-03 06:46:36 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-03 06:46:36 -0800 |
commit | b673748151b4e46b03592459f6eea4e250fc473a (patch) | |
tree | 75f11317c3f6dbea9ba1863d1b0408ada6a90d41 | |
parent | 34e5cb5070a36f2462cf53b7c64c68931dd68d45 (diff) | |
parent | fc64e8ec58961068ae91375325c4f96108ab39b9 (diff) | |
download | nextcloud-server-b673748151b4e46b03592459f6eea4e250fc473a.tar.gz nextcloud-server-b673748151b4e46b03592459f6eea4e250fc473a.zip |
Merge pull request #1063 from owncloud/translate_not_enough_space_available
add translation call for 'Not enough space available' upload error
-rw-r--r-- | apps/files/ajax/upload.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index e7823bc4ffb..2a2d935da6c 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -8,14 +8,15 @@ OCP\JSON::setContentTypeHeader('text/plain'); OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); +$l=OC_L10N::get('files'); if (!isset($_FILES['files'])) { - OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => $l->t( 'No file was uploaded. Unknown error' )))); exit(); } + foreach ($_FILES['files']['error'] as $error) { if ($error != 0) { - $l=OC_L10N::get('files'); $errors = array( UPLOAD_ERR_OK=>$l->t('There is no error, the file uploaded with success'), UPLOAD_ERR_INI_SIZE=>$l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ') @@ -41,7 +42,7 @@ foreach($files['size'] as $size) { $totalSize+=$size; } if($totalSize>OC_Filesystem::free_space($dir)) { - OCP\JSON::error(array('data' => array( 'message' => 'Not enough space available' ))); + OCP\JSON::error(array('data' => array( 'message' => $l->t( 'Not enough space available' )))); exit(); } @@ -65,7 +66,7 @@ if(strpos($dir, '..') === false) { OCP\JSON::encodedPrint($result); exit(); } else { - $error='invalid dir'; + $error=$l->t( 'Invalid directory.' ); } -OCP\JSON::error(array('data' => array('error' => $error, 'file' => $fileName))); +OCP\JSON::error(array('data' => array('message' => $error ))); |