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