Skip to content
Snippets Groups Projects
Commit b6737481 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #1063 from owncloud/translate_not_enough_space_available

add translation call for 'Not enough space available' upload error
parents 34e5cb50 fc64e8ec
No related branches found
No related tags found
No related merge requests found
......@@ -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 )));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment