Files: add translation support back to move/rename

This commit is contained in:
Robin Appelman 2013-02-07 23:57:18 +01:00
parent fc7230349b
commit b67251b0ff
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ $file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));
if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s - File with this name already exists", array($file)) )));
exit;
}
@ -22,8 +22,8 @@ if ($dir != '' || $file != 'Shared') {
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
} else {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}
}else{
OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}

View File

@ -17,8 +17,8 @@ if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.'
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
} else {
OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}
}else{
OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}