mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): use pluralization for invoke button tooltip
This commit is contained in:
parent
8dd0bfb068
commit
4ea8416c68
@ -261,7 +261,6 @@
|
|||||||
"queue": "Queue",
|
"queue": "Queue",
|
||||||
"queueFront": "Add to Front of Queue",
|
"queueFront": "Add to Front of Queue",
|
||||||
"queueBack": "Add to Queue",
|
"queueBack": "Add to Queue",
|
||||||
"queueCountPrediction": "{{promptsCount}} prompts \u00d7 {{iterations}} iterations -> {{count}} generations",
|
|
||||||
"queueEmpty": "Queue Empty",
|
"queueEmpty": "Queue Empty",
|
||||||
"enqueueing": "Queueing Batch",
|
"enqueueing": "Queueing Batch",
|
||||||
"resume": "Resume",
|
"resume": "Resume",
|
||||||
@ -314,7 +313,13 @@
|
|||||||
"batchFailedToQueue": "Failed to Queue Batch",
|
"batchFailedToQueue": "Failed to Queue Batch",
|
||||||
"graphQueued": "Graph queued",
|
"graphQueued": "Graph queued",
|
||||||
"graphFailedToQueue": "Failed to queue graph",
|
"graphFailedToQueue": "Failed to queue graph",
|
||||||
"openQueue": "Open Queue"
|
"openQueue": "Open Queue",
|
||||||
|
"prompts_one": "Prompt",
|
||||||
|
"prompts_other": "Prompts",
|
||||||
|
"iterations_one": "Iteration",
|
||||||
|
"iterations_other": "Iterations",
|
||||||
|
"generations_one": "Generation",
|
||||||
|
"generations_other": "Generations"
|
||||||
},
|
},
|
||||||
"invocationCache": {
|
"invocationCache": {
|
||||||
"invocationCache": "Invocation Cache",
|
"invocationCache": "Invocation Cache",
|
||||||
@ -958,8 +963,6 @@
|
|||||||
"positivePromptPlaceholder": "Positive Prompt",
|
"positivePromptPlaceholder": "Positive Prompt",
|
||||||
"globalPositivePromptPlaceholder": "Global Positive Prompt",
|
"globalPositivePromptPlaceholder": "Global Positive Prompt",
|
||||||
"iterations": "Iterations",
|
"iterations": "Iterations",
|
||||||
"iterationsWithCount_one": "{{count}} Iteration",
|
|
||||||
"iterationsWithCount_other": "{{count}} Iterations",
|
|
||||||
"scale": "Scale",
|
"scale": "Scale",
|
||||||
"scaleBeforeProcessing": "Scale Before Processing",
|
"scaleBeforeProcessing": "Scale Before Processing",
|
||||||
"scaledHeight": "Scaled H",
|
"scaledHeight": "Scaled H",
|
||||||
|
@ -35,12 +35,19 @@ const TooltipContent = memo(({ prepend = false }: Props) => {
|
|||||||
const { isReady, reasons } = useIsReadyToEnqueue();
|
const { isReady, reasons } = useIsReadyToEnqueue();
|
||||||
const isLoadingDynamicPrompts = useAppSelector((s) => s.dynamicPrompts.isLoading);
|
const isLoadingDynamicPrompts = useAppSelector((s) => s.dynamicPrompts.isLoading);
|
||||||
const promptsCount = useAppSelector(selectPromptsCount);
|
const promptsCount = useAppSelector(selectPromptsCount);
|
||||||
const iterations = useAppSelector((s) => s.generation.iterations);
|
const iterationsCount = useAppSelector((s) => s.generation.iterations);
|
||||||
const autoAddBoardId = useAppSelector((s) => s.gallery.autoAddBoardId);
|
const autoAddBoardId = useAppSelector((s) => s.gallery.autoAddBoardId);
|
||||||
const autoAddBoardName = useBoardName(autoAddBoardId);
|
const autoAddBoardName = useBoardName(autoAddBoardId);
|
||||||
const [_, { isLoading }] = useEnqueueBatchMutation({
|
const [_, { isLoading }] = useEnqueueBatchMutation({
|
||||||
fixedCacheKey: 'enqueueBatch',
|
fixedCacheKey: 'enqueueBatch',
|
||||||
});
|
});
|
||||||
|
const queueCountPredictionLabel = useMemo(() => {
|
||||||
|
const generationCount = Math.min(promptsCount * iterationsCount, 10000);
|
||||||
|
const prompts = t('queue.prompts', { count: promptsCount });
|
||||||
|
const iterations = t('queue.iterations', { count: iterationsCount });
|
||||||
|
const generations = t('queue.generations', { count: generationCount });
|
||||||
|
return `${promptsCount} ${prompts} \u00d7 ${iterationsCount} ${iterations} -> ${generationCount} ${generations}`.toLowerCase();
|
||||||
|
}, [iterationsCount, promptsCount, t]);
|
||||||
|
|
||||||
const label = useMemo(() => {
|
const label = useMemo(() => {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
@ -61,13 +68,7 @@ const TooltipContent = memo(({ prepend = false }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<Flex flexDir="column" gap={1}>
|
<Flex flexDir="column" gap={1}>
|
||||||
<Text fontWeight="semibold">{label}</Text>
|
<Text fontWeight="semibold">{label}</Text>
|
||||||
<Text>
|
<Text>{queueCountPredictionLabel}</Text>
|
||||||
{t('queue.queueCountPrediction', {
|
|
||||||
promptsCount,
|
|
||||||
iterations,
|
|
||||||
count: Math.min(promptsCount * iterations, 10000),
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
{reasons.length > 0 && (
|
{reasons.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<Divider opacity={0.2} borderColor="base.900" />
|
<Divider opacity={0.2} borderColor="base.900" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user