diff --git a/locales/en-US.yml b/locales/en-US.yml index 0e8d053bf..fd6db2757 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -976,6 +976,7 @@ failedToUpload: "Upload failed" cannotUploadBecauseInappropriate: "This file could not be uploaded because parts of it have been detected as potentially inappropriate." cannotUploadBecauseNoFreeSpace: "Upload failed due to lack of Drive capacity." cannotUploadBecauseExceedsFileSizeLimit: "This file cannot be uploaded as it exceeds the file size limit." +cannotUploadBecauseTimeout: "The file could not be uploaded due to a connection timeout." beta: "Beta" enableAutoSensitive: "Automatic marking as sensitive" enableAutoSensitiveDescription: "Allows automatic detection and marking of sensitive media through Machine Learning where possible. Even if this option is disabled, it may be enabled instance-wide." diff --git a/locales/index.d.ts b/locales/index.d.ts index c53f67dd2..e6dcc26dc 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3928,6 +3928,10 @@ export interface Locale extends ILocale { * ファイルサイズの制限を超えているためアップロードできません。 */ "cannotUploadBecauseExceedsFileSizeLimit": string; + /** + * 接続がタイムアウトしたため、ファイルをアップロードできませんでした。 + */ + "cannotUploadBecauseTimeout": string; /** * ベータ */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 7ad273c3b..297b5c976 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -978,6 +978,7 @@ failedToUpload: "アップロード失敗" cannotUploadBecauseInappropriate: "不適切な内容を含む可能性があると判定されたためアップロードできません。" cannotUploadBecauseNoFreeSpace: "ドライブの空き容量が無いためアップロードできません。" cannotUploadBecauseExceedsFileSizeLimit: "ファイルサイズの制限を超えているためアップロードできません。" +cannotUploadBecauseTimeout: "接続がタイムアウトしたため、ファイルをアップロードできませんでした。" beta: "ベータ" enableAutoSensitive: "自動センシティブ判定" enableAutoSensitiveDescription: "利用可能な場合は、機械学習を利用して自動でメディアにセンシティブフラグを設定します。この機能をオフにしても、サーバーによっては自動で設定されることがあります。" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 0f9111b2d..0adcf4984 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -975,6 +975,7 @@ failedToUpload: "업로드 실패" cannotUploadBecauseInappropriate: "이 파일은 부적절한 내용을 포함한다고 판단되어 업로드할 수 없습니다." cannotUploadBecauseNoFreeSpace: "드라이브 용량이 부족하여 업로드할 수 없습니다." cannotUploadBecauseExceedsFileSizeLimit: "파일 크기가 너무 크기 때문에 업로드할 수 없습니다." +cannotUploadBecauseTimeout: "접속 시간이 초과되어 파일을 업로드할 수 없습니다." beta: "베타" enableAutoSensitive: "자동 NSFW 탐지" enableAutoSensitiveDescription: "이용 가능할 경우 기계학습을 통해 자동으로 미디어 NSFW를 설정합니다. 이 기능을 해제하더라도, 서버 정책에 따라 자동으로 설정될 수 있습니다." diff --git a/packages/frontend/src/scripts/upload.ts b/packages/frontend/src/scripts/upload.ts index 3e947183c..f61b72993 100644 --- a/packages/frontend/src/scripts/upload.ts +++ b/packages/frontend/src/scripts/upload.ts @@ -98,6 +98,12 @@ export function uploadFile( title: i18n.ts.failedToUpload, text: i18n.ts.cannotUploadBecauseExceedsFileSizeLimit, }); + } else if (xhr.status === 524) { + alert({ + type: 'error', + title: i18n.ts.failedToUpload, + text: i18n.ts.cannotUploadBecauseTimeout, + }); } else if (ev.target?.response) { const res = JSON.parse(ev.target.response); if (res.error?.id === 'bec5bd69-fba3-43c9-b4fb-2894b66ad5d2') {