mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 21:23:22 +08:00
improve delete comment i18n
This commit is contained in:
parent
3d6295c622
commit
8470be6411
@ -9,6 +9,7 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
import { setAutoFreeze } from 'immer'
|
import { setAutoFreeze } from 'immer'
|
||||||
import {
|
import {
|
||||||
useEventListener,
|
useEventListener,
|
||||||
@ -201,6 +202,7 @@ export const Workflow: FC<WorkflowProps> = memo(({
|
|||||||
const showUserComments = useStore(s => s.showUserComments)
|
const showUserComments = useStore(s => s.showUserComments)
|
||||||
const showUserCursors = useStore(s => s.showUserCursors)
|
const showUserCursors = useStore(s => s.showUserCursors)
|
||||||
const mousePosition = useStore(s => s.mousePosition)
|
const mousePosition = useStore(s => s.mousePosition)
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
eventEmitter?.useSubscription((v: any) => {
|
eventEmitter?.useSubscription((v: any) => {
|
||||||
if (v.type === WORKFLOW_DATA_UPDATE) {
|
if (v.type === WORKFLOW_DATA_UPDATE) {
|
||||||
@ -245,28 +247,28 @@ export const Workflow: FC<WorkflowProps> = memo(({
|
|||||||
const handleCommentDeleteClick = useCallback((commentId: string) => {
|
const handleCommentDeleteClick = useCallback((commentId: string) => {
|
||||||
if (!showConfirm) {
|
if (!showConfirm) {
|
||||||
setShowConfirm({
|
setShowConfirm({
|
||||||
title: 'Delete this thread?',
|
title: t('workflow.comments.confirm.deleteThreadTitle'),
|
||||||
desc: 'This action will permanently delete the thread and all its replies. This cannot be undone.',
|
desc: t('workflow.comments.confirm.deleteThreadDesc'),
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await handleCommentDelete(commentId)
|
await handleCommentDelete(commentId)
|
||||||
setShowConfirm(undefined)
|
setShowConfirm(undefined)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [showConfirm, setShowConfirm, handleCommentDelete])
|
}, [showConfirm, setShowConfirm, handleCommentDelete, t])
|
||||||
|
|
||||||
const handleCommentReplyDeleteClick = useCallback((commentId: string, replyId: string) => {
|
const handleCommentReplyDeleteClick = useCallback((commentId: string, replyId: string) => {
|
||||||
if (!showConfirm) {
|
if (!showConfirm) {
|
||||||
setShowConfirm({
|
setShowConfirm({
|
||||||
title: 'Delete this reply?',
|
title: t('workflow.comments.confirm.deleteReplyTitle'),
|
||||||
desc: 'This reply will be removed permanently.',
|
desc: t('workflow.comments.confirm.deleteReplyDesc'),
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await handleCommentReplyDelete(commentId, replyId)
|
await handleCommentReplyDelete(commentId, replyId)
|
||||||
setShowConfirm(undefined)
|
setShowConfirm(undefined)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [showConfirm, setShowConfirm, handleCommentReplyDelete])
|
}, [showConfirm, setShowConfirm, handleCommentReplyDelete, t])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.addEventListener('visibilitychange', handleSyncWorkflowDraftWhenPageClose)
|
document.addEventListener('visibilitychange', handleSyncWorkflowDraftWhenPageClose)
|
||||||
|
|||||||
@ -200,6 +200,12 @@ const translation = {
|
|||||||
reply: 'Antworten',
|
reply: 'Antworten',
|
||||||
editReply: 'Antwort bearbeiten',
|
editReply: 'Antwort bearbeiten',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'Diesen Thread löschen?',
|
||||||
|
deleteThreadDesc: 'Dadurch werden der Thread und alle Antworten dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.',
|
||||||
|
deleteReplyTitle: 'Diese Antwort löschen?',
|
||||||
|
deleteReplyDesc: 'Diese Antwort wird dauerhaft entfernt.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Kommentar löschen',
|
deleteComment: 'Kommentar löschen',
|
||||||
resolveComment: 'Kommentar abschließen',
|
resolveComment: 'Kommentar abschließen',
|
||||||
|
|||||||
@ -206,6 +206,12 @@ const translation = {
|
|||||||
reply: 'Reply',
|
reply: 'Reply',
|
||||||
editReply: 'Edit reply',
|
editReply: 'Edit reply',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'Delete this thread?',
|
||||||
|
deleteThreadDesc: 'This action will permanently delete the thread and all its replies. This cannot be undone.',
|
||||||
|
deleteReplyTitle: 'Delete this reply?',
|
||||||
|
deleteReplyDesc: 'This reply will be removed permanently.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Delete comment',
|
deleteComment: 'Delete comment',
|
||||||
resolveComment: 'Resolve comment',
|
resolveComment: 'Resolve comment',
|
||||||
|
|||||||
@ -200,6 +200,12 @@ const translation = {
|
|||||||
reply: 'Responder',
|
reply: 'Responder',
|
||||||
editReply: 'Editar respuesta',
|
editReply: 'Editar respuesta',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: '¿Eliminar esta conversación?',
|
||||||
|
deleteThreadDesc: 'Esta acción eliminará permanentemente la conversación y todas sus respuestas. No se puede deshacer.',
|
||||||
|
deleteReplyTitle: '¿Eliminar esta respuesta?',
|
||||||
|
deleteReplyDesc: 'Esta respuesta se eliminará de forma permanente.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Eliminar comentario',
|
deleteComment: 'Eliminar comentario',
|
||||||
resolveComment: 'Resolver comentario',
|
resolveComment: 'Resolver comentario',
|
||||||
|
|||||||
@ -200,6 +200,12 @@ const translation = {
|
|||||||
reply: 'پاسخ',
|
reply: 'پاسخ',
|
||||||
editReply: 'ویرایش پاسخ',
|
editReply: 'ویرایش پاسخ',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'این گفتگو حذف شود؟',
|
||||||
|
deleteThreadDesc: 'این عملیات گفتگو و تمام پاسخهای آن را برای همیشه حذف میکند و قابل بازگردانی نیست.',
|
||||||
|
deleteReplyTitle: 'این پاسخ حذف شود؟',
|
||||||
|
deleteReplyDesc: 'این پاسخ برای همیشه حذف خواهد شد.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'حذف دیدگاه',
|
deleteComment: 'حذف دیدگاه',
|
||||||
resolveComment: 'حلکردن دیدگاه',
|
resolveComment: 'حلکردن دیدگاه',
|
||||||
|
|||||||
@ -200,6 +200,12 @@ const translation = {
|
|||||||
reply: 'Répondre',
|
reply: 'Répondre',
|
||||||
editReply: 'Modifier la réponse',
|
editReply: 'Modifier la réponse',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'Supprimer cette conversation ?',
|
||||||
|
deleteThreadDesc: 'Cette action supprimera définitivement la conversation et toutes ses réponses. Cette opération est irréversible.',
|
||||||
|
deleteReplyTitle: 'Supprimer cette réponse ?',
|
||||||
|
deleteReplyDesc: 'Cette réponse sera supprimée définitivement.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Supprimer le commentaire',
|
deleteComment: 'Supprimer le commentaire',
|
||||||
resolveComment: 'Résoudre le commentaire',
|
resolveComment: 'Résoudre le commentaire',
|
||||||
|
|||||||
@ -203,6 +203,12 @@ const translation = {
|
|||||||
reply: 'जवाब दें',
|
reply: 'जवाब दें',
|
||||||
editReply: 'जवाब संपादित करें',
|
editReply: 'जवाब संपादित करें',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'इस थ्रेड को हटाएं?',
|
||||||
|
deleteThreadDesc: 'यह क्रिया थ्रेड और उसकी सभी प्रतिक्रियाओं को स्थायी रूप से हटा देगी। इसे पूर्ववत नहीं किया जा सकता।',
|
||||||
|
deleteReplyTitle: 'इस जवाब को हटाएं?',
|
||||||
|
deleteReplyDesc: 'यह जवाब हमेशा के लिए हटा दिया जाएगा।',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'टिप्पणी हटाएं',
|
deleteComment: 'टिप्पणी हटाएं',
|
||||||
resolveComment: 'टिप्पणी समाधान करें',
|
resolveComment: 'टिप्पणी समाधान करें',
|
||||||
|
|||||||
@ -194,6 +194,12 @@ const translation = {
|
|||||||
reply: 'Balas',
|
reply: 'Balas',
|
||||||
editReply: 'Edit balasan',
|
editReply: 'Edit balasan',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'Hapus percakapan ini?',
|
||||||
|
deleteThreadDesc: 'Tindakan ini akan menghapus percakapan dan semua balasannya secara permanen. Tidak dapat dibatalkan.',
|
||||||
|
deleteReplyTitle: 'Hapus balasan ini?',
|
||||||
|
deleteReplyDesc: 'Balasan ini akan dihapus secara permanen.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Hapus komentar',
|
deleteComment: 'Hapus komentar',
|
||||||
resolveComment: 'Selesaikan komentar',
|
resolveComment: 'Selesaikan komentar',
|
||||||
|
|||||||
@ -205,6 +205,12 @@ const translation = {
|
|||||||
reply: 'Rispondi',
|
reply: 'Rispondi',
|
||||||
editReply: 'Modifica risposta',
|
editReply: 'Modifica risposta',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'Eliminare questa conversazione?',
|
||||||
|
deleteThreadDesc: 'Questa azione eliminerà in modo permanente la conversazione e tutte le risposte. Non sarà possibile annullare.',
|
||||||
|
deleteReplyTitle: 'Eliminare questa risposta?',
|
||||||
|
deleteReplyDesc: 'Questa risposta verrà rimossa definitivamente.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'Elimina commento',
|
deleteComment: 'Elimina commento',
|
||||||
resolveComment: 'Risolvi commento',
|
resolveComment: 'Risolvi commento',
|
||||||
|
|||||||
@ -204,6 +204,12 @@ const translation = {
|
|||||||
reply: '返信',
|
reply: '返信',
|
||||||
editReply: '返信を編集',
|
editReply: '返信を編集',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: 'このスレッドを削除しますか?',
|
||||||
|
deleteThreadDesc: 'この操作によりスレッドとその返信がすべて完全に削除され、元に戻せません。',
|
||||||
|
deleteReplyTitle: 'この返信を削除しますか?',
|
||||||
|
deleteReplyDesc: 'この返信は完全に削除されます。',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: 'コメントを削除',
|
deleteComment: 'コメントを削除',
|
||||||
resolveComment: 'コメントを解決',
|
resolveComment: 'コメントを解決',
|
||||||
|
|||||||
@ -208,6 +208,12 @@ const translation = {
|
|||||||
reply: '답글',
|
reply: '답글',
|
||||||
editReply: '답글 편집',
|
editReply: '답글 편집',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: '이 스레드를 삭제하시겠습니까?',
|
||||||
|
deleteThreadDesc: '이 작업을 수행하면 스레드와 모든 답글이 영구적으로 삭제되며 되돌릴 수 없습니다.',
|
||||||
|
deleteReplyTitle: '이 답글을 삭제하시겠습니까?',
|
||||||
|
deleteReplyDesc: '이 답글은 영구적으로 삭제됩니다.',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: '댓글 삭제',
|
deleteComment: '댓글 삭제',
|
||||||
resolveComment: '댓글 해결',
|
resolveComment: '댓글 해결',
|
||||||
|
|||||||
@ -206,6 +206,12 @@ const translation = {
|
|||||||
reply: '回复',
|
reply: '回复',
|
||||||
editReply: '编辑回复',
|
editReply: '编辑回复',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: '删除此讨论?',
|
||||||
|
deleteThreadDesc: '此操作会永久删除该讨论及其所有回复,且无法恢复。',
|
||||||
|
deleteReplyTitle: '删除此回复?',
|
||||||
|
deleteReplyDesc: '此回复将被永久删除。',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: '删除评论',
|
deleteComment: '删除评论',
|
||||||
resolveComment: '解决评论',
|
resolveComment: '解决评论',
|
||||||
|
|||||||
@ -200,6 +200,12 @@ const translation = {
|
|||||||
reply: '回覆',
|
reply: '回覆',
|
||||||
editReply: '編輯回覆',
|
editReply: '編輯回覆',
|
||||||
},
|
},
|
||||||
|
confirm: {
|
||||||
|
deleteThreadTitle: '刪除此討論串?',
|
||||||
|
deleteThreadDesc: '此操作會永久刪除該討論串及其所有回覆,且無法復原。',
|
||||||
|
deleteReplyTitle: '刪除此回覆?',
|
||||||
|
deleteReplyDesc: '此回覆將被永久刪除。',
|
||||||
|
},
|
||||||
aria: {
|
aria: {
|
||||||
deleteComment: '刪除評論',
|
deleteComment: '刪除評論',
|
||||||
resolveComment: '解決評論',
|
resolveComment: '解決評論',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user