summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-08 03:58:17 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-08 03:58:17 -0800
commit40f6e1eba00df4d1e67a8c3820d7a836499a7544 (patch)
treee7f5346df5a6c7c4c7e6005a9f651b35ecefcd70 /apps/files
parent59249ebc0ca3731711ee99d591742164b32d0cdd (diff)
parent9bdc43e1fcb4576c82fa03fd59deb2aa28282aba (diff)
downloadnextcloud-server-40f6e1eba00df4d1e67a8c3820d7a836499a7544.tar.gz
nextcloud-server-40f6e1eba00df4d1e67a8c3820d7a836499a7544.zip
Merge pull request #1534 from owncloud/files_l10n
Add translation support back to move/rename
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/move.php8
-rw-r--r--apps/files/ajax/rename.php6
-rw-r--r--apps/files/ajax/upload.php2
3 files changed, 10 insertions, 6 deletions
diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php
index 78ed218c136..93063e52eb0 100644
--- a/apps/files/ajax/move.php
+++ b/apps/files/ajax/move.php
@@ -11,8 +11,10 @@ $dir = stripslashes($_POST["dir"]);
$file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));
+$l = OC_L10N::get('files');
+
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 +24,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)) )));
}
diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php
index 970aaa638da..9fd2ce3ad4b 100644
--- a/apps/files/ajax/rename.php
+++ b/apps/files/ajax/rename.php
@@ -11,14 +11,16 @@ $dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
+$l = OC_L10N::get('files');
+
if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') {
$targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname);
$sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file);
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") )));
}
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 676612c0e42..07977f5ddf1 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -49,7 +49,7 @@ foreach ($files['size'] as $size) {
$totalSize += $size;
}
if ($totalSize > \OC\Files\Filesystem::free_space($dir)) {
- OCP\JSON::error(array('data' => array('message' => $l->t('Not enough space available'),
+ OCP\JSON::error(array('data' => array('message' => $l->t('Not enough storage available'),
'uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize)));
exit();