From a08369fe365a9fce1b3ba086e526bd502b7afbd5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 14 Jan 2023 17:46:45 +0900 Subject: [PATCH] =?UTF-8?q?enhance(client):=20=E5=88=86=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=82=84=E3=81=99=E3=81=84=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 1 + packages/frontend/src/os.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index d4fba36746..15a33932a5 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -932,6 +932,7 @@ assign: "アサイン" unassign: "アサインを解除" color: "色" manageCustomEmojis: "カスタム絵文字の管理" +youCannotCreateAnymore: "これ以上作成することはできません。" _role: new: "ロールの作成" diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 15d725defb..891d598d89 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -4,6 +4,7 @@ import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue'; import { EventEmitter } from 'eventemitter3'; import insertTextAtCursor from 'insert-text-at-cursor'; import * as Misskey from 'misskey-js'; +import { i18n } from './i18n'; import MkPostFormDialog from '@/components/MkPostFormDialog.vue'; import MkWaitingDialog from '@/components/MkWaitingDialog.vue'; import { MenuItem } from '@/types/menu'; @@ -17,9 +18,16 @@ export const apiWithDialog = (( ) => { const promise = api(endpoint, data, token); promiseDialog(promise, null, (err) => { + let title = null; + let text = err.message + '\n' + (err as any).id; + if (err.code.startsWith('TOO_MANY')) { + title = i18n.ts.youCannotCreateAnymore; + text = `${i18n.ts.error}: ${err.id}`; + } alert({ type: 'error', - text: err.message + '\n' + (err as any).id, + title, + text, }); });