]> source.dussan.org Git - nextcloud-server.git/commitdiff
Files: add translation support back to move/rename
authorRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 22:57:18 +0000 (23:57 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 7 Feb 2013 22:57:18 +0000 (23:57 +0100)
apps/files/ajax/move.php
apps/files/ajax/rename.php

index 78ed218c13623571cb41c6ce448e7c72a1617f4a..03d2a6a5624a286af2b6d3c4d2ad17b1f26628af 100644 (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)) )));
 }
index 970aaa638da89a578f11b381220adeae2ea1d889..2364e477d936d62c1342d7ddfdb66059eacb3cb7 100644 (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") )));
 }