Skip to content

Commit df47345

Browse files
feat(ui): add translation strings for prompt history
1 parent def0409 commit df47345

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@
243243
"resultSubtitle": "Choose how to handle the expanded prompt:",
244244
"replace": "Replace",
245245
"insert": "Insert",
246-
"discard": "Discard"
246+
"discard": "Discard",
247+
"noPromptHistory": "No prompt history recorded.",
248+
"noMatchingPrompts": "No matching prompts in history.",
249+
"toSwitchBetweenPrompts": "to switch between prompts."
247250
},
248251
"queue": {
249252
"queue": "Queue",

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from 'features/controlLayers/store/paramsSlice';
2424
import type { ChangeEvent } from 'react';
2525
import { memo, useCallback, useMemo, useState } from 'react';
26+
import { useTranslation } from 'react-i18next';
2627
import { PiArrowArcLeftBold, PiClockCounterClockwise, PiTrashBold, PiTrashSimpleBold } from 'react-icons/pi';
2728

2829
export const PositivePromptHistoryIconButton = memo(() => {
@@ -51,6 +52,7 @@ export const PositivePromptHistoryIconButton = memo(() => {
5152
PositivePromptHistoryIconButton.displayName = 'PositivePromptHistoryIconButton';
5253

5354
const PromptHistoryContent = memo(() => {
55+
const { t } = useTranslation();
5456
const dispatch = useAppDispatch();
5557
const positivePromptHistory = useAppSelector(selectPositivePromptHistory);
5658
const [searchTerm, setSearchTerm] = useState('');
@@ -100,12 +102,12 @@ const PromptHistoryContent = memo(() => {
100102
<Flex flexDir="column" flexGrow={1} minH={0}>
101103
{positivePromptHistory.length === 0 && (
102104
<Flex w="full" h="full" alignItems="center" justifyContent="center">
103-
<Text color="base.300">No prompt history recorded.</Text>
105+
<Text color="base.300">{t('prompt.noPromptHistory')}</Text>
104106
</Flex>
105107
)}
106108
{positivePromptHistory.length !== 0 && filteredPrompts.length === 0 && (
107109
<Flex w="full" h="full" alignItems="center" justifyContent="center">
108-
<Text color="base.300">No matching prompts in history.</Text>{' '}
110+
<Text color="base.300">{t('prompt.noMatchingPrompts')}</Text>{' '}
109111
</Flex>
110112
)}
111113
{filteredPrompts.length > 0 && (
@@ -120,7 +122,7 @@ const PromptHistoryContent = memo(() => {
120122
</Flex>
121123
<Flex alignItems="center" justifyContent="center" pt={1}>
122124
<Text color="base.300" textAlign="center">
123-
<Kbd textTransform="lowercase">alt+up/down</Kbd> to switch between prompts.
125+
<Kbd textTransform="lowercase">alt+up/down</Kbd> {t('prompt.toSwitchBetweenPrompts')}
124126
</Text>
125127
</Flex>
126128
</Flex>

0 commit comments

Comments
 (0)