Files: add translation support back to move/rename
This commit is contained in:
parent
fc7230349b
commit
b67251b0ff
|
@ -12,7 +12,7 @@ $file = stripslashes($_POST["file"]);
|
||||||
$target = stripslashes(rawurldecode($_POST["target"]));
|
$target = stripslashes(rawurldecode($_POST["target"]));
|
||||||
|
|
||||||
if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ if ($dir != '' || $file != 'Shared') {
|
||||||
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
|
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
|
||||||
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
|
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
|
||||||
} else {
|
} 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{
|
}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)) )));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.'
|
||||||
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
|
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
|
||||||
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
|
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
|
||||||
} else {
|
} 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{
|
}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") )));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue