From 0dd8c65ef45452d9148b0de598baffd6cdcc9427 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Sun, 20 Apr 2025 18:36:44 +0800 Subject: [PATCH] fix(locale): add notification channel messages and update password reset email content in multiple languages --- .../plugin-auth/src/client/basic/Options.tsx | 42 ++++++++++++++++++- .../plugin-auth/src/locale/de-DE.json | 7 +++- .../plugin-auth/src/locale/en-US.json | 7 +++- .../plugin-auth/src/locale/it-IT.json | 7 +++- .../plugin-auth/src/locale/ja-JP.json | 7 +++- .../plugin-auth/src/locale/ko-KR.json | 7 +++- .../plugin-auth/src/locale/nl-NL.json | 7 +++- .../plugin-auth/src/locale/zh-CN.json | 7 +++- 8 files changed, 83 insertions(+), 8 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-auth/src/client/basic/Options.tsx b/packages/plugins/@nocobase/plugin-auth/src/client/basic/Options.tsx index b35769dd25..54592de71f 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/client/basic/Options.tsx +++ b/packages/plugins/@nocobase/plugin-auth/src/client/basic/Options.tsx @@ -11,8 +11,9 @@ import { SchemaComponent, useCollectionManager, useCurrentUserVariable, useDatet import React, { useEffect, useMemo } from 'react'; import { lang, useAuthTranslation } from '../locale'; import { FormTab, ArrayTable } from '@formily/antd-v5'; -import { Alert } from 'antd'; +import { Alert, Divider } from 'antd'; import { uid } from '@formily/shared'; +import { Link } from 'react-router-dom'; const SignupFormSettings = () => { const record = useRecord(); @@ -160,6 +161,12 @@ const useVariableOptionsOfForgetPassword = () => { export const Options = () => { const { t } = useAuthTranslation(); const forgetPasswordVariableOptions = useVariableOptionsOfForgetPassword(); + const noChannelsFoundMessage = ( + + {t('No notification channels found. Please ')} + {t('add one first')}. + + ); return ( { 'x-component': 'Checkbox', default: false, }, + divider1: { + type: 'void', + 'x-component': () => { + return {t('1. Select a notification channel (Currently only email is supported)')}; + }, + 'x-reactions': [ + { + dependencies: ['.public.enableResetPassword'], + fulfill: { + state: { + visible: '{{$deps[0]}}', + }, + }, + }, + ], + }, notificationChannel: { type: 'string', title: '{{t("Notification Channel (Email)")}}', @@ -237,6 +260,23 @@ export const Options = () => { }, }, }, + notFoundContent: noChannelsFoundMessage, + }, + 'x-reactions': [ + { + dependencies: ['.public.enableResetPassword'], + fulfill: { + state: { + visible: '{{$deps[0]}}', + }, + }, + }, + ], + }, + divider2: { + type: 'void', + 'x-component': () => { + return {t('2. Configure the password reset email')}; }, 'x-reactions': [ { diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/de-DE.json b/packages/plugins/@nocobase/plugin-auth/src/locale/de-DE.json index 5251174857..3a07fa9ab1 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/de-DE.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/de-DE.json @@ -70,5 +70,10 @@ "Plain text": "Reiner Text", "defaultResetPasswordEmailSubject": "Setzen Sie Ihr Passwort für [Ihr App-/Website-Name] zurück", "defaultResetPasswordEmailContentHTML": "

Hallo {{$user.username}},

\n\n

Wir haben eine Anfrage zum Zurücksetzen des Passworts für Ihr [Ihr App-/Website-Name]-Konto erhalten.

\n\n

Bitte klicken Sie auf den untenstehenden Link, um Ihr neues Passwort festzulegen:

\n\n

\n Passwort zurücksetzen\n

\n\n

\n Wenn Sie keine Passwortzurücksetzung angefordert haben, ignorieren Sie bitte diese E-Mail. Ihr Passwort bleibt unverändert.\n

\n\n

\n Bitte beachten Sie: Zu Ihrer Sicherheit läuft dieser Link zum Zurücksetzen des Passworts in [Gültigkeitsdauer, z. B. 24 Stunden] ab.\n

\n\n

Wenn Sie Probleme beim Zurücksetzen Ihres Passworts haben, wenden Sie sich bitte an unser Support-Team.

\n\n

\n Danke,
\n Das [Ihr Firmenname]-Team\n

", - "defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWir haben eine Anfrage zum Zurücksetzen des Passworts für Ihr [Ihr App-/Website-Name]-Konto erhalten.\n\nBitte klicken Sie auf den untenstehenden Link, um Ihr neues Passwort festzulegen:\n\n{{$resetLink}}\n\nWenn Sie keine Passwortzurücksetzung angefordert haben, ignorieren Sie bitte diese E-Mail. Ihr Passwort bleibt unverändert.\n\nBitte beachten Sie: Zu Ihrer Sicherheit läuft dieser Link zum Zurücksetzen des Passworts in [Gültigkeitsdauer, z. B. 24 Stunden] ab.\n\nWenn Sie Probleme beim Zurücksetzen Ihres Passworts haben, wenden Sie sich bitte an unser Support-Team.\n\nDanke, Das [Ihr Firmenname]-Team" + "defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWir haben eine Anfrage zum Zurücksetzen des Passworts für Ihr [Ihr App-/Website-Name]-Konto erhalten.\n\nBitte klicken Sie auf den untenstehenden Link, um Ihr neues Passwort festzulegen:\n\n{{$resetLink}}\n\nWenn Sie keine Passwortzurücksetzung angefordert haben, ignorieren Sie bitte diese E-Mail. Ihr Passwort bleibt unverändert.\n\nBitte beachten Sie: Zu Ihrer Sicherheit läuft dieser Link zum Zurücksetzen des Passworts in [Gültigkeitsdauer, z. B. 24 Stunden] ab.\n\nWenn Sie Probleme beim Zurücksetzen Ihres Passworts haben, wenden Sie sich bitte an unser Support-Team.\n\nDanke, Das [Ihr Firmenname]-Team", + "No notification channels found. Please ": "Keine Benachrichtigungskanäle gefunden. Bitte ", + "add one first": "fügen Sie zuerst einen hinzu", + "Reset password email": "E-Mail zum Zurücksetzen des Passworts", + "1. Select a notification channel (Currently only email is supported)": "1. Wählen Sie einen Benachrichtigungskanal aus (Derzeit wird nur E-Mail unterstützt)", + "2. Configure the password reset email": "2. Konfigurieren Sie die E-Mail zum Zurücksetzen des Passworts" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/en-US.json b/packages/plugins/@nocobase/plugin-auth/src/locale/en-US.json index c74a2ebd20..292921df57 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/en-US.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/en-US.json @@ -69,5 +69,10 @@ "Plain text": "Plain text", "defaultResetPasswordEmailSubject": "Reset your password for [Your App/Website Name]", "defaultResetPasswordEmailContentHTML": "

Hello {{$user.username}},

\n\n

We received a request to reset the password for your [Your App/Website Name] account.

\n\n

Please click the link below to set your new password:

\n\n

\n Reset Your Password\n

\n\n

\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n

\n\n

\n Please note: For your security, this password reset link will expire in [Validity Period, e.g., 24 hours].\n

\n\n

If you encounter any issues resetting your password, please contact our support team.

\n\n

\n Thanks,
\n The [Your Company Name] Team\n

", - "defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your [Your App/Website Name] account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in [Validity Period, e.g., 24 hours].\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The [Your Company Name] Team" + "defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your [Your App/Website Name] account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in [Validity Period, e.g., 24 hours].\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The [Your Company Name] Team", + "No notification channels found. Please ": "No notification channels found. Please ", + "add one first": "add one first", + "Reset password email": "Reset password email", + "1. Select a notification channel (Currently only email is supported)": "1. Select a notification channel (Currently only email is supported)", + "2. Configure the password reset email": "2. Configure the password reset email" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/it-IT.json b/packages/plugins/@nocobase/plugin-auth/src/locale/it-IT.json index 33a27bdfa1..e4821a0100 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/it-IT.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/it-IT.json @@ -75,5 +75,10 @@ "Plain text": "Testo semplice", "defaultResetPasswordEmailSubject": "Reimposta la tua password per [Nome App/Sito Web]", "defaultResetPasswordEmailContentHTML": "

Ciao {{$user.username}},

\n\n

Abbiamo ricevuto una richiesta per reimpostare la password del tuo account [Nome App/Sito Web].

\n\n

Per favore, clicca sul link sottostante per impostare la tua nuova password:

\n\n

\n Reimposta la tua password\n

\n\n

\n Se non hai richiesto la reimpostazione della password, ignora questa email. La tua password rimarrà invariata.\n

\n\n

\n Nota bene: Per la tua sicurezza, questo link per la reimpostazione della password scadrà tra [Periodo di validità, es. 24 ore].\n

\n\n

Se riscontri problemi nel reimpostare la password, contatta il nostro team di supporto.

\n\n

\n Grazie,
\n Il Team di [Nome Azienda]\n

", - "defaultResetPasswordEmailContentText": "Ciao {{$user.username}},\n\nAbbiamo ricevuto una richiesta per reimpostare la password del tuo account [Nome App/Sito Web].\n\nPer favore, clicca sul link sottostante per impostare la tua nuova password:\n\n{{$resetLink}}\n\nSe non hai richiesto la reimpostazione della password, ignora questa email. La tua password rimarrà invariata.\n\nNota bene: Per la tua sicurezza, questo link per la reimpostazione della password scadrà tra [Periodo di validità, es. 24 ore].\n\nSe riscontri problemi nel reimpostare la password, contatta il nostro team di supporto.\n\nGrazie, Il Team di [Nome Azienda]" + "defaultResetPasswordEmailContentText": "Ciao {{$user.username}},\n\nAbbiamo ricevuto una richiesta per reimpostare la password del tuo account [Nome App/Sito Web].\n\nPer favore, clicca sul link sottostante per impostare la tua nuova password:\n\n{{$resetLink}}\n\nSe non hai richiesto la reimpostazione della password, ignora questa email. La tua password rimarrà invariata.\n\nNota bene: Per la tua sicurezza, questo link per la reimpostazione della password scadrà tra [Periodo di validità, es. 24 ore].\n\nSe riscontri problemi nel reimpostare la password, contatta il nostro team di supporto.\n\nGrazie, Il Team di [Nome Azienda]", + "No notification channels found. Please ": "Nessun canale di notifica trovato. Per favore ", + "add one first": "aggiungine uno prima", + "Reset password email": "Email di reimpostazione della password", + "1. Select a notification channel (Currently only email is supported)": "1. Seleziona un canale di notifica (Attualmente è supportata solo l'email)", + "2. Configure the password reset email": "2. Configurare l'email per il reset della password" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/ja-JP.json b/packages/plugins/@nocobase/plugin-auth/src/locale/ja-JP.json index 273f5d7f64..39c6073992 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/ja-JP.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/ja-JP.json @@ -47,5 +47,10 @@ "Plain text": "プレーンテキスト", "defaultResetPasswordEmailSubject": "[アプリ/ウェブサイト名] のパスワードをリセットしてください", "defaultResetPasswordEmailContentHTML": "

{{$user.username}} 様、

\n\n

[アプリ/ウェブサイト名] アカウントのパスワードリセットリクエストを受け付けました。

\n\n

以下のリンクをクリックして新しいパスワードを設定してください:

\n\n

\n パスワードをリセット\n

\n\n

\n パスワードのリセットをリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。\n

\n\n

\n 注意: セキュリティのため、このパスワードリセットリンクは [有効期間、例: 24時間] で期限切れになります。\n

\n\n

パスワードのリセットで問題が発生した場合は、サポートチームにお問い合わせください。

\n\n

\n ありがとうございます、
\n [会社名] チーム\n

", - "defaultResetPasswordEmailContentText": "{{$user.username}} 様、\n\n[アプリ/ウェブサイト名] アカウントのパスワードリセットリクエストを受け付けました。\n\n以下のリンクをクリックして新しいパスワードを設定してください:\n\n{{$resetLink}}\n\nパスワードのリセットをリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。\n\n注意: セキュリティのため、このパスワードリセットリンクは [有効期間、例: 24時間] で期限切れになります。\n\nパスワードのリセットで問題が発生した場合は、サポートチームにお問い合わせください。\n\nありがとうございます、[会社名] チーム" + "defaultResetPasswordEmailContentText": "{{$user.username}} 様、\n\n[アプリ/ウェブサイト名] アカウントのパスワードリセットリクエストを受け付けました。\n\n以下のリンクをクリックして新しいパスワードを設定してください:\n\n{{$resetLink}}\n\nパスワードのリセットをリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。\n\n注意: セキュリティのため、このパスワードリセットリンクは [有効期間、例: 24時間] で期限切れになります。\n\nパスワードのリセットで問題が発生した場合は、サポートチームにお問い合わせください。\n\nありがとうございます、[会社名] チーム", + "No notification channels found. Please ": "通知チャネルが見つかりません。", + "add one first": "最初に追加してください", + "Reset password email": "パスワードリセットメール", + "1. Select a notification channel (Currently only email is supported)": "1. 通知チャネルを選択(現在はメールのみサポート)", + "2. Configure the password reset email": "2. パスワードリセット用のメールを設定する" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/ko-KR.json b/packages/plugins/@nocobase/plugin-auth/src/locale/ko-KR.json index 679b1d4c04..907ce9adcb 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/ko-KR.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/ko-KR.json @@ -47,5 +47,10 @@ "Plain text": "일반 텍스트", "defaultResetPasswordEmailSubject": "[앱/웹사이트 이름]의 비밀번호를 재설정하세요", "defaultResetPasswordEmailContentHTML": "

안녕하세요 {{$user.username}}님,

\n\n

[앱/웹사이트 이름] 계정의 비밀번호 재설정 요청을 받았습니다.

\n\n

아래 링크를 클릭하여 새 비밀번호를 설정하세요:

\n\n

\n 비밀번호 재설정\n

\n\n

\n 비밀번호 재설정을 요청하지 않으셨다면 이 이메일을 무시하세요. 비밀번호는 변경되지 않습니다.\n

\n\n

\n 참고: 보안을 위해 이 비밀번호 재설정 링크는 [유효 기간, 예: 24시간] 후에 만료됩니다.\n

\n\n

비밀번호 재설정에 문제가 발생하면 지원팀에 문의하세요.

\n\n

\n 감사합니다,
\n [회사 이름] 팀 드림\n

", - "defaultResetPasswordEmailContentText": "안녕하세요 {{$user.username}}님,\n\n[앱/웹사이트 이름] 계정의 비밀번호 재설정 요청을 받았습니다.\n\n아래 링크를 클릭하여 새 비밀번호를 설정하세요:\n\n{{$resetLink}}\n\n비밀번호 재설정을 요청하지 않으셨다면 이 이메일을 무시하세요. 비밀번호는 변경되지 않습니다.\n\n참고: 보안을 위해 이 비밀번호 재설정 링크는 [유효 기간, 예: 24시간] 후에 만료됩니다.\n\n비밀번호 재설정에 문제가 발생하면 지원팀에 문의하세요.\n\n감사합니다, [회사 이름] 팀 드림" + "defaultResetPasswordEmailContentText": "안녕하세요 {{$user.username}}님,\n\n[앱/웹사이트 이름] 계정의 비밀번호 재설정 요청을 받았습니다.\n\n아래 링크를 클릭하여 새 비밀번호를 설정하세요:\n\n{{$resetLink}}\n\n비밀번호 재설정을 요청하지 않으셨다면 이 이메일을 무시하세요. 비밀번호는 변경되지 않습니다.\n\n참고: 보안을 위해 이 비밀번호 재설정 링크는 [유효 기간, 예: 24시간] 후에 만료됩니다.\n\n비밀번호 재설정에 문제가 발생하면 지원팀에 문의하세요.\n\n감사합니다, [회사 이름] 팀 드림", + "No notification channels found. Please ": "알림 채널을 찾을 수 없습니다. ", + "add one first": "먼저 하나 추가하세요", + "Reset password email": "비밀번호 재설정 이메일", + "1. Select a notification channel (Currently only email is supported)": "1. 알림 채널 선택 (현재 이메일만 지원됨)", + "2. Configure the password reset email": "2. 비밀번호 재설정 이메일 구성" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/nl-NL.json b/packages/plugins/@nocobase/plugin-auth/src/locale/nl-NL.json index 9f71c58751..c193c45698 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/nl-NL.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/nl-NL.json @@ -53,5 +53,10 @@ "Plain text": "Gewone tekst", "defaultResetPasswordEmailSubject": "Stel je wachtwoord opnieuw in voor [Naam van je app/website]", "defaultResetPasswordEmailContentHTML": "

Hallo {{$user.username}},

\n\n

We hebben een verzoek ontvangen om het wachtwoord voor je [Naam van je app/website]-account opnieuw in te stellen.

\n\n

Klik op de onderstaande link om je nieuwe wachtwoord in te stellen:

\n\n

\n Stel je wachtwoord opnieuw in\n

\n\n

\n Als je geen wachtwoordreset hebt aangevraagd, negeer dan deze e-mail. Je wachtwoord blijft ongewijzigd.\n

\n\n

\n Let op: Voor je veiligheid verloopt deze wachtwoordresetlink over [Geldigheidsperiode, bijv. 24 uur].\n

\n\n

Als je problemen ondervindt bij het opnieuw instellen van je wachtwoord, neem dan contact op met ons ondersteuningsteam.

\n\n

\n Bedankt,
\n Het [Naam van je bedrijf] Team\n

", - "defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWe hebben een verzoek ontvangen om het wachtwoord voor je [Naam van je app/website]-account opnieuw in te stellen.\n\nKlik op de onderstaande link om je nieuwe wachtwoord in te stellen:\n\n{{$resetLink}}\n\nAls je geen wachtwoordreset hebt aangevraagd, negeer dan deze e-mail. Je wachtwoord blijft ongewijzigd.\n\nLet op: Voor je veiligheid verloopt deze wachtwoordresetlink over [Geldigheidsperiode, bijv. 24 uur].\n\nAls je problemen ondervindt bij het opnieuw instellen van je wachtwoord, neem dan contact op met ons ondersteuningsteam.\n\nBedankt, Het [Naam van je bedrijf] Team" + "defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWe hebben een verzoek ontvangen om het wachtwoord voor je [Naam van je app/website]-account opnieuw in te stellen.\n\nKlik op de onderstaande link om je nieuwe wachtwoord in te stellen:\n\n{{$resetLink}}\n\nAls je geen wachtwoordreset hebt aangevraagd, negeer dan deze e-mail. Je wachtwoord blijft ongewijzigd.\n\nLet op: Voor je veiligheid verloopt deze wachtwoordresetlink over [Geldigheidsperiode, bijv. 24 uur].\n\nAls je problemen ondervindt bij het opnieuw instellen van je wachtwoord, neem dan contact op met ons ondersteuningsteam.\n\nBedankt, Het [Naam van je bedrijf] Team", + "No notification channels found. Please ": "Geen meldingskanalen gevonden. Gelieve ", + "add one first": "een toe te voegen", + "Reset password email": "Wachtwoord opnieuw instellen e-mail", + "1. Select a notification channel (Currently only email is supported)": "1. Selecteer een meldingskanaal (Momenteel wordt alleen e-mail ondersteund)", + "2. Configure the password reset email": "2. Configureer de e-mail voor het resetten van het wachtwoord" } diff --git a/packages/plugins/@nocobase/plugin-auth/src/locale/zh-CN.json b/packages/plugins/@nocobase/plugin-auth/src/locale/zh-CN.json index 51df89d718..3d939aca89 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/locale/zh-CN.json +++ b/packages/plugins/@nocobase/plugin-auth/src/locale/zh-CN.json @@ -69,5 +69,10 @@ "Plain text": "普通文本", "defaultResetPasswordEmailSubject": "重置您的 [应用/网站名称] 密码", "defaultResetPasswordEmailContentHTML": "

您好 {{$user.username}},

\n\n

我们收到了重置您 [应用/网站名称] 账户密码的请求。

\n\n

请点击下面的链接设置您的新密码:

\n\n

\n 重置您的密码\n

\n\n

\n 如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\n

\n\n

\n 请注意:为了您的安全,此密码重置链接将在 [有效期,例如 24 小时] 后过期。\n

\n\n

如果您在重置密码时遇到任何问题,请联系我们的支持团队。

\n\n

\n 谢谢,
\n [您的公司名称] 团队\n

", - "defaultResetPasswordEmailContentText": "您好 {{$user.username}},\n\n我们收到了重置您 [应用/网站名称] 账户密码的请求。\n\n请点击下面的链接设置您的新密码:\n\n{{$resetLink}}\n\n如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\n\n请注意:为了您的安全,此密码重置链接将在 [有效期,例如 24 小时] 后过期。\n\n如果您在重置密码时遇到任何问题,请联系我们的支持团队。\n\n谢谢,[您的公司名称] 团队" + "defaultResetPasswordEmailContentText": "您好 {{$user.username}},\n\n我们收到了重置您 [应用/网站名称] 账户密码的请求。\n\n请点击下面的链接设置您的新密码:\n\n{{$resetLink}}\n\n如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\n\n请注意:为了您的安全,此密码重置链接将在 [有效期,例如 24 小时] 后过期。\n\n如果您在重置密码时遇到任何问题,请联系我们的支持团队。\n\n谢谢,[您的公司名称] 团队", + "No notification channels found. Please ": "未找到通知渠道,请", + "add one first": "先添加一个", + "Reset password email": "重置密码邮件", + "1. Select a notification channel (Currently only email is supported)": "1. 选择一个通知渠道(目前仅支持电子邮件)", + "2. Configure the password reset email": "2. 配置用来重置密码的邮件" }