l10n support enhanced in files_trashbin

This commit is contained in:
Thomas Mueller 2013-02-07 16:31:04 +01:00
parent 488ab0dba2
commit 18a288a3c3
2 changed files with 6 additions and 3 deletions

View File

@ -18,6 +18,7 @@ if ($path_parts['dirname'] == '.') {
if (OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) {
OCP\JSON::success(array("data" => array("filename" => $file)));
} else {
OCP\JSON::error(array("data" => array("message" => "Couldn't delete ".$file. " permanently")));
$l = OC_L10N::get('files_trashbin');
OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file)))));
}

View File

@ -37,8 +37,10 @@ if ( $error ) {
foreach ( $error as $e ) {
$filelist .= $e.', ';
}
OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".rtrim($filelist,', '), "success" => $success, "error" => $error)));
$l = OC_L10N::get('files_trashbin');
$message = $l->t("Couldn't restore %s", array(rtrim($filelist,', ')));
OCP\JSON::error(array("data" => array("message" => $message,
"success" => $success, "error" => $error)));
} else {
OCP\JSON::success(array("data" => array("success" => $success)));
}