diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index f00aa68e..ce9a04da 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -454,10 +454,13 @@ ui: synonyms_text: The following tags will be remapped to delete: title: Delete this tag - content: >- -

We do not allowed deleting tag with posts.

Please remove this tag - from the posts first.

- content2: Are you sure you wish to delete? + tip_with_posts: >- +

We do not allowed deleting tag with posts.

+

Please remove this tag from the posts first.

+ tip_with_synonyms: >- +

We do not allowed deleting tag with synonyms.

+

Please remove the synonyms from this tag first.

+ tip: Are you sure you wish to delete? close: Close edit_tag: title: Edit Tag diff --git a/ui/src/pages/Tags/Info/index.tsx b/ui/src/pages/Tags/Info/index.tsx index c28600e7..7a1e2d4c 100644 --- a/ui/src/pages/Tags/Info/index.tsx +++ b/ui/src/pages/Tags/Info/index.tsx @@ -86,15 +86,27 @@ const TagIntroduction = () => { if (synonymsData?.synonyms && synonymsData.synonyms.length > 0) { Modal.confirm({ title: t('delete.title'), - content: t('delete.content2'), + content: t('delete.tip_with_synonyms'), showConfirm: false, cancelText: t('delete.close'), }); return; } + if (tagInfo.question_count > 0) { + Modal.confirm({ + title: t('delete.title'), + content: t('delete.tip_with_posts'), + showConfirm: false, + cancelText: t('delete.close'), + }); + return; + } + Modal.confirm({ title: t('delete.title'), - content: t('delete.content'), + content: t('delete.tip'), + confirmText: t('delete', { keyPrefix: 'btns' }), + confirmBtnVariant: 'danger', onConfirm: () => { deleteTag(tagInfo.tag_id); },