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)',
252
+
[
253
+
$this->l10n->n('%n byte', '%n bytes', $count),
254
+
$this->l10n->n('%n byte', '%n bytes', $expected),
255
+
],
256
+
)
257
+
);
239
258
}
240
259
}
241
260
@@ -245,7 +264,15 @@ public function put($data) {
245
264
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
246
265
$expected = (int)$_SERVER['CONTENT_LENGTH'];
247
266
if ($count !== $expected) {
248
-
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.');
267
+
thrownewBadRequest(
268
+
$this->l10n->t(
269
+
'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.',
270
+
[
271
+
$this->l10n->n('%n byte', '%n bytes', $expected),
272
+
$this->l10n->n('%n byte', '%n bytes', $count),
273
+
],
274
+
)
275
+
);
249
276
}
250
277
}
251
278
} catch (\Exception$e) {
@@ -266,7 +293,7 @@ public function put($data) {
266
293
if ($needsPartFile) {
267
294
if ($view && !$this->emitPreHooks($exists)) {
268
295
$partStorage->unlink($internalPartPath);
269
-
thrownewException('Could not rename part file to final file, canceled by hook');
296
+
thrownewException($this->l10n->t('Could not rename part file to final file, canceled by hook'));
@@ -536,7 +563,15 @@ private function createFileChunked($data) {
536
563
$expected = (int)$_SERVER['CONTENT_LENGTH'];
537
564
if ($bytesWritten !== $expected) {
538
565
$chunk_handler->remove($info['index']);
539
-
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.');
566
+
thrownewBadRequest(
567
+
$this->l10n->t(
568
+
'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