From a282fdb397f37d59ba184ffbc3edaa1a2472fe95 Mon Sep 17 00:00:00 2001 From: yukineko <27853966+hideki0403@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:55:33 +0900 Subject: [PATCH] =?UTF-8?q?add:=20=E3=82=AF=E3=83=A9=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=83=B3=E3=83=88=E5=81=B4=E3=81=AB=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 4 ++++ .../src/components/MkSignupDialog.form.vue | 17 ++++++++++++++++- .../frontend/src/pages/admin/moderation.vue | 9 +++++++++ packages/frontend/src/pages/signup-complete.vue | 3 ++- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index eb27983087..9cbd676d98 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1158,6 +1158,9 @@ export interface Locale { "pullDownToRefresh": string; "disableStreamingTimeline": string; "useGroupedNotifications": string; + "emailVerificationExpiresIn": string; + "emailVerificationExpiresInDescription": string; + "signupPendingError": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; @@ -1635,6 +1638,7 @@ export interface Locale { "almostThere": string; "emailAddressInfo": string; "emailSent": string; + "expiresTime": string; }; "_accountDelete": { "accountDelete": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 4af21ab529..f2e59333ae 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1155,6 +1155,9 @@ refreshing: "リロード中" pullDownToRefresh: "引っ張ってリロード" disableStreamingTimeline: "タイムラインのリアルタイム更新を無効にする" useGroupedNotifications: "通知をグルーピングして表示する" +emailVerificationExpiresIn: "メール認証の有効期限" +emailVerificationExpiresInDescription: "指定した有効期限を超えた場合はアカウントのサインアップが無効になりますが、サインアップ時に使用した招待コードが再度使用できるようになるなどのメリットがあります。0で無効になります。" +signupPendingError: "メールアドレスの確認中に問題が発生しました。リンクの有効期限が切れている可能性があります。" _announcement: forExistingUsers: "既存ユーザーのみ" @@ -1554,6 +1557,7 @@ _signup: almostThere: "ほとんど完了です" emailAddressInfo: "あなたが使っているメールアドレスを入力してください。メールアドレスが公開されることはありません。" emailSent: "入力されたメールアドレス({email})宛に確認のメールが送信されました。メールに記載されたリンクにアクセスすると、アカウントの作成が完了します。" + expiresTime: "メールに記載されているリンクの有効期限は{time}です。" _accountDelete: accountDelete: "アカウントの削除" diff --git a/packages/frontend/src/components/MkSignupDialog.form.vue b/packages/frontend/src/components/MkSignupDialog.form.vue index a67251eda1..c1eb5f5381 100644 --- a/packages/frontend/src/components/MkSignupDialog.form.vue +++ b/packages/frontend/src/components/MkSignupDialog.form.vue @@ -254,10 +254,25 @@ async function onSubmit(): Promise { 'turnstile-response': turnstileResponse, }); if (instance.emailRequiredForSignup) { + const text = [i18n.t('_signup.emailSent', { email })]; + + if (instance.emailVerificationExpiresIn) { + let time = ''; + const hours = Math.floor(instance.emailVerificationExpiresIn / 60); + const minutes = instance.emailVerificationExpiresIn % 60; + if (hours > 0) { + time += hours + i18n.t('_time.hour'); + } + if (minutes > 0) { + time += minutes + i18n.t('_time.minute'); + } + text.push(i18n.t('_signup.expiresTime', { time })); + } + os.alert({ type: 'success', title: i18n.ts._signup.almostThere, - text: i18n.t('_signup.emailSent', { email }), + text: text.join('\n'), }); emit('signupEmailPending'); } else { diff --git a/packages/frontend/src/pages/admin/moderation.vue b/packages/frontend/src/pages/admin/moderation.vue index 59ee041386..0a7f743847 100644 --- a/packages/frontend/src/pages/admin/moderation.vue +++ b/packages/frontend/src/pages/admin/moderation.vue @@ -18,6 +18,12 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + {{ i18n.ts.serverRules }} @@ -71,6 +77,7 @@ import FormLink from '@/components/form/link.vue'; let enableRegistration: boolean = $ref(false); let emailRequiredForSignup: boolean = $ref(false); +let emailVerificationExpiresIn: number = $ref(0); let sensitiveWords: string = $ref(''); let preservedUsernames: string = $ref(''); let tosUrl: string | null = $ref(null); @@ -80,6 +87,7 @@ async function init() { const meta = await os.api('admin/meta'); enableRegistration = !meta.disableRegistration; emailRequiredForSignup = meta.emailRequiredForSignup; + emailVerificationExpiresIn = meta.emailVerificationExpiresIn; sensitiveWords = meta.sensitiveWords.join('\n'); preservedUsernames = meta.preservedUsernames.join('\n'); tosUrl = meta.tosUrl; @@ -90,6 +98,7 @@ function save() { os.apiWithDialog('admin/update-meta', { disableRegistration: !enableRegistration, emailRequiredForSignup, + emailVerificationExpiresIn, tosUrl, privacyPolicyUrl, sensitiveWords: sensitiveWords.split('\n'), diff --git a/packages/frontend/src/pages/signup-complete.vue b/packages/frontend/src/pages/signup-complete.vue index e9c89fa3bb..d9a730851d 100644 --- a/packages/frontend/src/pages/signup-complete.vue +++ b/packages/frontend/src/pages/signup-complete.vue @@ -51,7 +51,8 @@ function submit() { os.alert({ type: 'error', - text: i18n.ts.somethingHappened, + title: i18n.ts.somethingHappened, + text: i18n.ts.signupPendingError, }); }); }