You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Error while copying file to target location (copied: %1$s, expected filesize: %2$s)',
248
+
[
249
+
$this->l10n->n('%n byte', '%n bytes', $count),
250
+
$this->l10n->n('%n byte', '%n bytes', $expected),
251
+
],
252
+
)
253
+
);
236
254
}
237
255
}
238
256
@@ -242,7 +260,15 @@ public function put($data) {
242
260
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
243
261
$expected = (int)$_SERVER['CONTENT_LENGTH'];
244
262
if ($count !== $expected) {
245
-
thrownewBadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $count . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.');
263
+
thrownewBadRequest(
264
+
$this->l10n->t(
265
+
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
266
+
[
267
+
$this->l10n->n('%n byte', '%n bytes', $expected),
268
+
$this->l10n->n('%n byte', '%n bytes', $count),
269
+
],
270
+
)
271
+
);
246
272
}
247
273
}
248
274
} catch (\Exception$e) {
@@ -263,7 +289,7 @@ public function put($data) {
263
289
if ($needsPartFile) {
264
290
if ($view && !$this->emitPreHooks($exists)) {
265
291
$partStorage->unlink($internalPartPath);
266
-
thrownewException('Could not rename part file to final file, canceled by hook');
292
+
thrownewException($this->l10n->t('Could not rename part file to final file, canceled by hook'));
@@ -533,7 +559,15 @@ private function createFileChunked($data) {
533
559
$expected = (int)$_SERVER['CONTENT_LENGTH'];
534
560
if ($bytesWritten !== $expected) {
535
561
$chunk_handler->remove($info['index']);
536
-
thrownewBadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $bytesWritten . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.');
562
+
thrownewBadRequest(
563
+
$this->l10n->t(
564
+
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
0 commit comments