Skip to content

Commit e2721b4

Browse files
translations(ui): add atranslations for add/remove negative promtp
1 parent 17118a0 commit e2721b4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

invokeai/frontend/web/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
"t2iAdapter": "T2I Adapter",
115115
"positivePrompt": "Positive Prompt",
116116
"negativePrompt": "Negative Prompt",
117+
"removeNegativePrompt": "Remove Negative Prompt",
118+
"addNegativePrompt": "Add Negative Prompt",
117119
"discordLabel": "Discord",
118120
"dontAskMeAgain": "Don't ask me again",
119121
"dontShowMeThese": "Don't show me these",

invokeai/frontend/web/src/features/parameters/components/Core/NegativePromptToggleButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { IconButton, Tooltip } from '@invoke-ai/ui-library';
22
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
33
import { negativePromptChanged, selectHasNegativePrompt } from 'features/controlLayers/store/paramsSlice';
44
import { memo, useCallback, useMemo } from 'react';
5+
import { useTranslation } from 'react-i18next';
56
import { PiPlusMinusBold } from 'react-icons/pi';
67

78
export const NegativePromptToggleButton = memo(() => {
9+
const { t } = useTranslation();
810
const hasNegativePrompt = useAppSelector(selectHasNegativePrompt);
911

1012
const dispatch = useAppDispatch();
@@ -18,8 +20,8 @@ export const NegativePromptToggleButton = memo(() => {
1820
}, [dispatch, hasNegativePrompt]);
1921

2022
const label = useMemo(
21-
() => (hasNegativePrompt ? 'Remove Negative Prompt' : 'Add Negative Prompt'),
22-
[hasNegativePrompt]
23+
() => (hasNegativePrompt ? t('common.removeNegativePrompt') : t('common.addNegativePrompt')),
24+
[hasNegativePrompt, t]
2325
);
2426

2527
return (

0 commit comments

Comments
 (0)