From adad4bcfe3a8dac2c8f6b053b2e0229852b5cd47 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Feb 2023 10:45:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=83=AD=E3=83=83=E3=83=97=E6=99=82?= =?UTF-8?q?=E3=81=AE=E8=B3=AA=E5=95=8F=E3=82=92=E5=88=86=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=82=84=E3=81=99=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 2 ++ packages/frontend/src/components/MkDialog.vue | 6 ++++-- packages/frontend/src/os.ts | 2 ++ packages/frontend/src/pages/settings/profile.vue | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 14ab9d7c7..79b78f3f9 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -864,6 +864,8 @@ failedToFetchAccountInformation: "アカウント情報の取得に失敗しま rateLimitExceeded: "レート制限を超えました" cropImage: "画像のクロップ" cropImageAsk: "画像をクロップしますか?" +cropYes: "クロップする" +cropNo: "そのまま使う" file: "ファイル" recentNHours: "直近{n}時間" recentNDays: "直近{n}日" diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue index 74cb53485..da4db6340 100644 --- a/packages/frontend/src/components/MkDialog.vue +++ b/packages/frontend/src/components/MkDialog.vue @@ -28,8 +28,8 @@
- {{ (showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt }} - {{ i18n.ts.cancel }} + {{ okText ?? ((showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt) }} + {{ cancelText ?? i18n.ts.cancel }}
{{ action.text }} @@ -82,6 +82,8 @@ const props = withDefaults(defineProps<{ showOkButton?: boolean; showCancelButton?: boolean; cancelableByBgClick?: boolean; + okText?: string; + cancelText?: string; }>(), { type: 'info', showOkButton: true, diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 52469b6d0..e21a21ef7 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -171,6 +171,8 @@ export function confirm(props: { type: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question'; title?: string | null; text?: string | null; + okText?: string; + cancelText?: string; }): Promise<{ canceled: boolean }> { return new Promise((resolve, reject) => { popup(MkDialog, { diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index da7d3d370..3647e90ce 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -150,6 +150,8 @@ function changeAvatar(ev) { const { canceled } = await os.confirm({ type: 'question', text: i18n.t('cropImageAsk'), + okText: i18n.ts.cropYes, + cancelText: i18n.ts.cropNo, }); if (!canceled) { @@ -174,6 +176,8 @@ function changeBanner(ev) { const { canceled } = await os.confirm({ type: 'question', text: i18n.t('cropImageAsk'), + okText: i18n.ts.cropYes, + cancelText: i18n.ts.cropNo, }); if (!canceled) {