mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
chore: add i18n support for ai confirm modal (#8116)
This commit is contained in:
+13
-5
@@ -410,17 +410,25 @@ const AISettings = () => {
|
||||
const onToggleAI = useCallback(
|
||||
(checked: boolean) => {
|
||||
openConfirmModal({
|
||||
title: checked ? 'Enable AI?' : 'Disable AI?',
|
||||
description: `Are you sure you want to ${checked ? 'enable' : 'disable'} AI?`,
|
||||
confirmText: checked ? 'Enable' : 'Disable',
|
||||
cancelText: 'Cancel',
|
||||
title: checked
|
||||
? t['com.affine.settings.editorSettings.general.ai.enable.title']()
|
||||
: t['com.affine.settings.editorSettings.general.ai.disable.title'](),
|
||||
description: checked
|
||||
? t[
|
||||
'com.affine.settings.editorSettings.general.ai.enable.description'
|
||||
]()
|
||||
: t[
|
||||
'com.affine.settings.editorSettings.general.ai.disable.description'
|
||||
](),
|
||||
confirmText: checked ? t['Enable']() : t['Disable'](),
|
||||
cancelText: t['Cancel'](),
|
||||
onConfirm: () => onAIChange(checked),
|
||||
confirmButtonOptions: {
|
||||
variant: checked ? 'primary' : 'error',
|
||||
},
|
||||
});
|
||||
},
|
||||
[openConfirmModal, onAIChange]
|
||||
[openConfirmModal, t, onAIChange]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user