mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix plurals (#4860)
This commit is contained in:
commit
80d329c900
@ -1,4 +1,5 @@
|
|||||||
dist/
|
dist/
|
||||||
|
public/locales/*.json
|
||||||
.husky/
|
.husky/
|
||||||
node_modules/
|
node_modules/
|
||||||
patches/
|
patches/
|
||||||
|
@ -45,10 +45,12 @@
|
|||||||
"accept": "Accept",
|
"accept": "Accept",
|
||||||
"advanced": "Advanced",
|
"advanced": "Advanced",
|
||||||
"areYouSure": "Are you sure?",
|
"areYouSure": "Are you sure?",
|
||||||
|
"auto": "Auto",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"batch": "Batch Manager",
|
"batch": "Batch Manager",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
|
"on": "On",
|
||||||
"communityLabel": "Community",
|
"communityLabel": "Community",
|
||||||
"controlNet": "ControlNet",
|
"controlNet": "ControlNet",
|
||||||
"controlAdapter": "Control Adapter",
|
"controlAdapter": "Control Adapter",
|
||||||
@ -133,7 +135,8 @@
|
|||||||
"upload": "Upload"
|
"upload": "Upload"
|
||||||
},
|
},
|
||||||
"controlnet": {
|
"controlnet": {
|
||||||
"controlAdapter": "Control Adapter",
|
"controlAdapter_one": "Control Adapter",
|
||||||
|
"controlAdapter_other": "Control Adapters",
|
||||||
"controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
|
"controlnet": "$t(controlnet.controlAdapter) #{{number}} ($t(common.controlNet))",
|
||||||
"ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
|
"ip_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.ipAdapter))",
|
||||||
"t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
|
"t2i_adapter": "$t(controlnet.controlAdapter) #{{number}} ($t(common.t2iAdapter))",
|
||||||
@ -275,7 +278,8 @@
|
|||||||
"batchValues": "Batch Values",
|
"batchValues": "Batch Values",
|
||||||
"notReady": "Unable to Queue",
|
"notReady": "Unable to Queue",
|
||||||
"batchQueued": "Batch Queued",
|
"batchQueued": "Batch Queued",
|
||||||
"batchQueuedDesc": "Added {{item_count}} sessions to {{direction}} of queue",
|
"batchQueuedDesc_one": "Added {{count}} sessions to {{direction}} of queue",
|
||||||
|
"batchQueuedDesc_other": "Added {{count}} sessions to {{direction}} of queue",
|
||||||
"front": "front",
|
"front": "front",
|
||||||
"back": "back",
|
"back": "back",
|
||||||
"batchFailedToQueue": "Failed to Queue Batch",
|
"batchFailedToQueue": "Failed to Queue Batch",
|
||||||
@ -701,6 +705,7 @@
|
|||||||
"vae": "VAE",
|
"vae": "VAE",
|
||||||
"vaeLocation": "VAE Location",
|
"vaeLocation": "VAE Location",
|
||||||
"vaeLocationValidationMsg": "Path to where your VAE is located.",
|
"vaeLocationValidationMsg": "Path to where your VAE is located.",
|
||||||
|
"vaePrecision": "VAE Precision",
|
||||||
"vaeRepoID": "VAE Repo ID",
|
"vaeRepoID": "VAE Repo ID",
|
||||||
"vaeRepoIDValidationMsg": "Online repository of your VAE",
|
"vaeRepoIDValidationMsg": "Online repository of your VAE",
|
||||||
"variant": "Variant",
|
"variant": "Variant",
|
||||||
@ -921,6 +926,7 @@
|
|||||||
},
|
},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"aspectRatio": "Aspect Ratio",
|
"aspectRatio": "Aspect Ratio",
|
||||||
|
"aspectRatioFree": "Free",
|
||||||
"boundingBoxHeader": "Bounding Box",
|
"boundingBoxHeader": "Bounding Box",
|
||||||
"boundingBoxHeight": "Bounding Box Height",
|
"boundingBoxHeight": "Bounding Box Height",
|
||||||
"boundingBoxWidth": "Bounding Box Width",
|
"boundingBoxWidth": "Bounding Box Width",
|
||||||
@ -1111,17 +1117,17 @@
|
|||||||
"clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
|
"clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
|
||||||
"clearIntermediatesDesc3": "Your gallery images will not be deleted.",
|
"clearIntermediatesDesc3": "Your gallery images will not be deleted.",
|
||||||
"clearIntermediates": "Clear Intermediates",
|
"clearIntermediates": "Clear Intermediates",
|
||||||
"clearIntermediates_one": "Clear 1 Intermediate",
|
"clearIntermediatesWithCount_one": "Clear {{count}} Intermediate",
|
||||||
"clearIntermediates_other": "Clear {{number}} Intermediates",
|
"clearIntermediatesWithCount_other": "Clear {{count}} Intermediates",
|
||||||
"noIntermediates": "No Intermediates to Clear",
|
"clearIntermediatesWithCount_zero": "No Intermediates to Clear",
|
||||||
"intermediatesCleared_one": "Cleared 1 Intermediate",
|
"intermediatesCleared_one": "Cleared {{count}} Intermediate",
|
||||||
"intermediatesCleared_other": "Cleared {{number}} Intermediates",
|
"intermediatesCleared_other": "Cleared {{count}} Intermediates",
|
||||||
"intermediatesClearedFailed": "Problem Clearing Intermediates"
|
"intermediatesClearedFailed": "Problem Clearing Intermediates"
|
||||||
},
|
},
|
||||||
"toast": {
|
"toast": {
|
||||||
"addedToBoard": "Added to board",
|
"addedToBoard": "Added to board",
|
||||||
"baseModelChangedCleared_one": "Base model changed, cleared or disabled {{number}} incompatible submodel",
|
"baseModelChangedCleared_one": "Base model changed, cleared or disabled {{count}} incompatible submodel",
|
||||||
"baseModelChangedCleared_many": "$t(toast.baseModelChangedCleared_one)s",
|
"baseModelChangedCleared_other": "Base model changed, cleared or disabled {{count}} incompatible submodels",
|
||||||
"canceled": "Processing Canceled",
|
"canceled": "Processing Canceled",
|
||||||
"canvasCopiedClipboard": "Canvas Copied to Clipboard",
|
"canvasCopiedClipboard": "Canvas Copied to Clipboard",
|
||||||
"canvasDownloaded": "Canvas Downloaded",
|
"canvasDownloaded": "Canvas Downloaded",
|
||||||
|
@ -30,7 +30,7 @@ export const addBatchEnqueuedListener = () => {
|
|||||||
id: 'batch-queued',
|
id: 'batch-queued',
|
||||||
title: t('queue.batchQueued'),
|
title: t('queue.batchQueued'),
|
||||||
description: t('queue.batchQueuedDesc', {
|
description: t('queue.batchQueuedDesc', {
|
||||||
item_count: response.enqueued,
|
count: response.enqueued,
|
||||||
direction: arg.prepend ? t('queue.front') : t('queue.back'),
|
direction: arg.prepend ? t('queue.front') : t('queue.back'),
|
||||||
}),
|
}),
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
|
@ -73,14 +73,9 @@ export const addModelSelectedListener = () => {
|
|||||||
dispatch(
|
dispatch(
|
||||||
addToast(
|
addToast(
|
||||||
makeToast({
|
makeToast({
|
||||||
title: t(
|
title: t('toast.baseModelChangedCleared', {
|
||||||
modelsCleared === 1
|
count: modelsCleared,
|
||||||
? 'toast.baseModelChangedCleared_one'
|
}),
|
||||||
: 'toast.baseModelChangedCleared_many',
|
|
||||||
{
|
|
||||||
number: modelsCleared,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -45,7 +45,7 @@ const selector = createSelector(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
activeLayerColor,
|
activeLayerColor,
|
||||||
activeLayerString: layer.charAt(0).toUpperCase() + layer.slice(1),
|
layer,
|
||||||
boundingBoxColor,
|
boundingBoxColor,
|
||||||
boundingBoxCoordinatesString: `(${roundToHundreth(
|
boundingBoxCoordinatesString: `(${roundToHundreth(
|
||||||
boxX
|
boxX
|
||||||
@ -73,7 +73,7 @@ const selector = createSelector(
|
|||||||
const IAICanvasStatusText = () => {
|
const IAICanvasStatusText = () => {
|
||||||
const {
|
const {
|
||||||
activeLayerColor,
|
activeLayerColor,
|
||||||
activeLayerString,
|
layer,
|
||||||
boundingBoxColor,
|
boundingBoxColor,
|
||||||
boundingBoxCoordinatesString,
|
boundingBoxCoordinatesString,
|
||||||
boundingBoxDimensionsString,
|
boundingBoxDimensionsString,
|
||||||
@ -116,7 +116,9 @@ const IAICanvasStatusText = () => {
|
|||||||
style={{
|
style={{
|
||||||
color: activeLayerColor,
|
color: activeLayerColor,
|
||||||
}}
|
}}
|
||||||
>{`${t('unifiedCanvas.activeLayer')}: ${activeLayerString}`}</Box>
|
>{`${t('unifiedCanvas.activeLayer')}: ${t(
|
||||||
|
`unifiedCanvas.${layer}`
|
||||||
|
)}`}</Box>
|
||||||
<Box>{`${t('unifiedCanvas.canvasScale')}: ${canvasScaleString}%`}</Box>
|
<Box>{`${t('unifiedCanvas.canvasScale')}: ${canvasScaleString}%`}</Box>
|
||||||
{shouldPreserveMaskedArea && (
|
{shouldPreserveMaskedArea && (
|
||||||
<Box
|
<Box
|
||||||
@ -124,7 +126,7 @@ const IAICanvasStatusText = () => {
|
|||||||
color: warningColor,
|
color: warningColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Preserve Masked Area: On
|
{t('unifiedCanvas.preserveMaskedArea')}: {t('common.on')}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{shouldShowBoundingBox && (
|
{shouldShowBoundingBox && (
|
||||||
|
@ -89,7 +89,12 @@ const ControlAdaptersCollapse = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label="Control Adapters" activeLabel={activeLabel}>
|
<IAICollapse
|
||||||
|
label={t('controlnet.controlAdapter', {
|
||||||
|
count: controlAdapterIds.length,
|
||||||
|
})}
|
||||||
|
activeLabel={activeLabel}
|
||||||
|
>
|
||||||
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
||||||
<ButtonGroup size="sm" w="full" justifyContent="space-between">
|
<ButtonGroup size="sm" w="full" justifyContent="space-between">
|
||||||
<IAIButton
|
<IAIButton
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { Badge, Flex } from '@chakra-ui/react';
|
import { Badge, Flex } from '@chakra-ui/react';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const AutoAddIcon = () => {
|
const AutoAddIcon = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
sx={{
|
sx={{
|
||||||
@ -15,7 +17,7 @@ const AutoAddIcon = () => {
|
|||||||
variant="solid"
|
variant="solid"
|
||||||
sx={{ bg: 'accent.400', _dark: { bg: 'accent.500' } }}
|
sx={{ bg: 'accent.400', _dark: { bg: 'accent.500' } }}
|
||||||
>
|
>
|
||||||
auto
|
{t('common.auto')}
|
||||||
</Badge>
|
</Badge>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
@ -20,6 +20,7 @@ import BoardsList from './Boards/BoardsList/BoardsList';
|
|||||||
import GalleryBoardName from './GalleryBoardName';
|
import GalleryBoardName from './GalleryBoardName';
|
||||||
import GallerySettingsPopover from './GallerySettingsPopover';
|
import GallerySettingsPopover from './GallerySettingsPopover';
|
||||||
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
|
import GalleryImageGrid from './ImageGrid/GalleryImageGrid';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
[stateSelector],
|
[stateSelector],
|
||||||
@ -34,6 +35,7 @@ const selector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const ImageGalleryContent = () => {
|
const ImageGalleryContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const resizeObserverRef = useRef<HTMLDivElement>(null);
|
const resizeObserverRef = useRef<HTMLDivElement>(null);
|
||||||
const galleryGridRef = useRef<HTMLDivElement>(null);
|
const galleryGridRef = useRef<HTMLDivElement>(null);
|
||||||
const { galleryView } = useAppSelector(selector);
|
const { galleryView } = useAppSelector(selector);
|
||||||
@ -111,7 +113,7 @@ const ImageGalleryContent = () => {
|
|||||||
leftIcon={<FaImages />}
|
leftIcon={<FaImages />}
|
||||||
data-testid="images-tab"
|
data-testid="images-tab"
|
||||||
>
|
>
|
||||||
Images
|
{t('gallery.images')}
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab
|
<Tab
|
||||||
as={IAIButton}
|
as={IAIButton}
|
||||||
@ -124,7 +126,7 @@ const ImageGalleryContent = () => {
|
|||||||
leftIcon={<FaServer />}
|
leftIcon={<FaServer />}
|
||||||
data-testid="assets-tab"
|
data-testid="assets-tab"
|
||||||
>
|
>
|
||||||
Assets
|
{t('gallery.assets')}
|
||||||
</Tab>
|
</Tab>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</TabList>
|
</TabList>
|
||||||
|
@ -9,6 +9,7 @@ import { memo } from 'react';
|
|||||||
import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
|
import { useFeatureStatus } from '../../system/hooks/useFeatureStatus';
|
||||||
import ParamLoraList from './ParamLoraList';
|
import ParamLoraList from './ParamLoraList';
|
||||||
import ParamLoRASelect from './ParamLoraSelect';
|
import ParamLoRASelect from './ParamLoraSelect';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -22,6 +23,7 @@ const selector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const ParamLoraCollapse = () => {
|
const ParamLoraCollapse = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const { activeLabel } = useAppSelector(selector);
|
const { activeLabel } = useAppSelector(selector);
|
||||||
|
|
||||||
const isLoraEnabled = useFeatureStatus('lora').isFeatureEnabled;
|
const isLoraEnabled = useFeatureStatus('lora').isFeatureEnabled;
|
||||||
@ -31,7 +33,7 @@ const ParamLoraCollapse = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label="LoRA" activeLabel={activeLabel}>
|
<IAICollapse label={t('modelManager.loraModels')} activeLabel={activeLabel}>
|
||||||
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
<Flex sx={{ flexDir: 'column', gap: 2 }}>
|
||||||
<ParamLoRASelect />
|
<ParamLoRASelect />
|
||||||
<ParamLoraList />
|
<ParamLoraList />
|
||||||
|
@ -6,10 +6,11 @@ import {
|
|||||||
setAspectRatio,
|
setAspectRatio,
|
||||||
setShouldLockAspectRatio,
|
setShouldLockAspectRatio,
|
||||||
} from 'features/parameters/store/generationSlice';
|
} from 'features/parameters/store/generationSlice';
|
||||||
|
import i18next from 'i18next';
|
||||||
import { activeTabNameSelector } from '../../../../ui/store/uiSelectors';
|
import { activeTabNameSelector } from '../../../../ui/store/uiSelectors';
|
||||||
|
|
||||||
const aspectRatios = [
|
const aspectRatios = [
|
||||||
{ name: 'Free', value: null },
|
{ name: i18next.t('parameters.aspectRatioFree'), value: null },
|
||||||
{ name: '2:3', value: 2 / 3 },
|
{ name: '2:3', value: 2 / 3 },
|
||||||
{ name: '16:9', value: 16 / 9 },
|
{ name: '16:9', value: 16 / 9 },
|
||||||
{ name: '1:1', value: 1 / 1 },
|
{ name: '1:1', value: 1 / 1 },
|
||||||
|
@ -7,6 +7,7 @@ import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
|||||||
import { vaePrecisionChanged } from 'features/parameters/store/generationSlice';
|
import { vaePrecisionChanged } from 'features/parameters/store/generationSlice';
|
||||||
import { PrecisionParam } from 'features/parameters/types/parameterSchemas';
|
import { PrecisionParam } from 'features/parameters/types/parameterSchemas';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo, useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -20,6 +21,7 @@ const selector = createSelector(
|
|||||||
const DATA = ['fp16', 'fp32'];
|
const DATA = ['fp16', 'fp32'];
|
||||||
|
|
||||||
const ParamVAEModelSelect = () => {
|
const ParamVAEModelSelect = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { vaePrecision } = useAppSelector(selector);
|
const { vaePrecision } = useAppSelector(selector);
|
||||||
|
|
||||||
@ -37,7 +39,7 @@ const ParamVAEModelSelect = () => {
|
|||||||
return (
|
return (
|
||||||
<IAIInformationalPopover feature="paramVAEPrecision">
|
<IAIInformationalPopover feature="paramVAEPrecision">
|
||||||
<IAIMantineSelect
|
<IAIMantineSelect
|
||||||
label="VAE Precision"
|
label={t('modelManager.vaePrecision')}
|
||||||
value={vaePrecision}
|
value={vaePrecision}
|
||||||
data={DATA}
|
data={DATA}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
@ -60,9 +60,9 @@ const QueueButtonTooltipContent = ({ prepend = false }: Props) => {
|
|||||||
)}
|
)}
|
||||||
<StyledDivider />
|
<StyledDivider />
|
||||||
<Text fontWeight={400} fontStyle="oblique 10deg">
|
<Text fontWeight={400} fontStyle="oblique 10deg">
|
||||||
Adding images to{' '}
|
{t('parameters.invoke.addingImagesTo')}{' '}
|
||||||
<Text as="span" fontWeight={600}>
|
<Text as="span" fontWeight={600}>
|
||||||
{autoAddBoardName || 'Uncategorized'}
|
{autoAddBoardName || t('boards.uncategorized')}
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -14,6 +14,7 @@ import { generationSelector } from 'features/parameters/store/generationSelector
|
|||||||
import { uiSelector } from 'features/ui/store/uiSelectors';
|
import { uiSelector } from 'features/ui/store/uiSelectors';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
|
import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
[uiSelector, generationSelector],
|
[uiSelector, generationSelector],
|
||||||
@ -29,10 +30,15 @@ const selector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const SDXLImageToImageTabCoreParameters = () => {
|
const SDXLImageToImageTabCoreParameters = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const { shouldUseSliders, activeLabel } = useAppSelector(selector);
|
const { shouldUseSliders, activeLabel } = useAppSelector(selector);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label="General" activeLabel={activeLabel} defaultIsOpen={true}>
|
<IAICollapse
|
||||||
|
label={t('parameters.general')}
|
||||||
|
activeLabel={activeLabel}
|
||||||
|
defaultIsOpen={true}
|
||||||
|
>
|
||||||
<Flex
|
<Flex
|
||||||
sx={{
|
sx={{
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
@ -12,6 +12,7 @@ import ParamSteps from 'features/parameters/components/Parameters/Core/ParamStep
|
|||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
|
import ParamSDXLImg2ImgDenoisingStrength from './ParamSDXLImg2ImgDenoisingStrength';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
stateSelector,
|
stateSelector,
|
||||||
@ -27,10 +28,15 @@ const selector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const SDXLUnifiedCanvasTabCoreParameters = () => {
|
const SDXLUnifiedCanvasTabCoreParameters = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const { shouldUseSliders, activeLabel } = useAppSelector(selector);
|
const { shouldUseSliders, activeLabel } = useAppSelector(selector);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse label="General" activeLabel={activeLabel} defaultIsOpen={true}>
|
<IAICollapse
|
||||||
|
label={t('parameters.general')}
|
||||||
|
activeLabel={activeLabel}
|
||||||
|
defaultIsOpen={true}
|
||||||
|
>
|
||||||
<Flex
|
<Flex
|
||||||
sx={{
|
sx={{
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Heading, Text } from '@chakra-ui/react';
|
import { Heading, Text } from '@chakra-ui/react';
|
||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
import { controlAdaptersReset } from 'features/controlAdapters/store/controlAdaptersSlice';
|
import { controlAdaptersReset } from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import IAIButton from '../../../../common/components/IAIButton';
|
import IAIButton from '../../../../common/components/IAIButton';
|
||||||
import {
|
import {
|
||||||
@ -25,15 +25,12 @@ export default function SettingsClearIntermediates() {
|
|||||||
const handleClickClearIntermediates = useCallback(() => {
|
const handleClickClearIntermediates = useCallback(() => {
|
||||||
clearIntermediates()
|
clearIntermediates()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.then((number) => {
|
.then((clearedCount) => {
|
||||||
dispatch(controlAdaptersReset());
|
dispatch(controlAdaptersReset());
|
||||||
dispatch(resetCanvas());
|
dispatch(resetCanvas());
|
||||||
dispatch(
|
dispatch(
|
||||||
addToast({
|
addToast({
|
||||||
title:
|
title: t('settings.intermediatesCleared', { count: clearedCount }),
|
||||||
number === 1
|
|
||||||
? t('settings.intermediatesCleared_one')
|
|
||||||
: t('settings.intermediatesCleared_other', { number }),
|
|
||||||
status: 'info',
|
status: 'info',
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -53,18 +50,6 @@ export default function SettingsClearIntermediates() {
|
|||||||
updateIntermediatesCount();
|
updateIntermediatesCount();
|
||||||
}, [updateIntermediatesCount]);
|
}, [updateIntermediatesCount]);
|
||||||
|
|
||||||
const buttonText = useMemo(() => {
|
|
||||||
if (!intermediatesCount) {
|
|
||||||
return t('settings.noIntermediates');
|
|
||||||
}
|
|
||||||
if (intermediatesCount === 1) {
|
|
||||||
return t('settings.clearIntermediates_one');
|
|
||||||
}
|
|
||||||
return t('settings.clearIntermediates_other', {
|
|
||||||
number: intermediatesCount,
|
|
||||||
});
|
|
||||||
}, [intermediatesCount, t]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledFlex>
|
<StyledFlex>
|
||||||
<Heading size="sm">{t('settings.clearIntermediates')}</Heading>
|
<Heading size="sm">{t('settings.clearIntermediates')}</Heading>
|
||||||
@ -74,7 +59,9 @@ export default function SettingsClearIntermediates() {
|
|||||||
isLoading={isLoadingClearIntermediates}
|
isLoading={isLoadingClearIntermediates}
|
||||||
isDisabled={!intermediatesCount}
|
isDisabled={!intermediatesCount}
|
||||||
>
|
>
|
||||||
{buttonText}
|
{t('settings.clearIntermediatesWithCount', {
|
||||||
|
count: intermediatesCount ?? 0,
|
||||||
|
})}
|
||||||
</IAIButton>
|
</IAIButton>
|
||||||
<Text fontWeight="bold">{t('settings.clearIntermediatesDesc1')}</Text>
|
<Text fontWeight="bold">{t('settings.clearIntermediatesDesc1')}</Text>
|
||||||
<Text variant="subtext">{t('settings.clearIntermediatesDesc2')}</Text>
|
<Text variant="subtext">{t('settings.clearIntermediatesDesc2')}</Text>
|
||||||
|
@ -11,14 +11,16 @@ import ImageToImageStrength from 'features/parameters/components/Parameters/Imag
|
|||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const ImageToImageTabCoreParameters = () => {
|
const ImageToImageTabCoreParameters = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
||||||
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse
|
<IAICollapse
|
||||||
label="General"
|
label={t('parameters.general')}
|
||||||
activeLabel={iterationsAndSeedLabel}
|
activeLabel={iterationsAndSeedLabel}
|
||||||
defaultIsOpen={true}
|
defaultIsOpen={true}
|
||||||
>
|
>
|
||||||
|
@ -9,14 +9,16 @@ import ParamSteps from 'features/parameters/components/Parameters/Core/ParamStep
|
|||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const TextToImageTabCoreParameters = () => {
|
const TextToImageTabCoreParameters = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
||||||
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse
|
<IAICollapse
|
||||||
label="General"
|
label={t('parameters.general')}
|
||||||
activeLabel={iterationsAndSeedLabel}
|
activeLabel={iterationsAndSeedLabel}
|
||||||
defaultIsOpen={true}
|
defaultIsOpen={true}
|
||||||
>
|
>
|
||||||
|
@ -10,14 +10,16 @@ import ImageToImageStrength from 'features/parameters/components/Parameters/Imag
|
|||||||
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
import ParamSeedFull from 'features/parameters/components/Parameters/Seed/ParamSeedFull';
|
||||||
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
import { useCoreParametersCollapseLabel } from 'features/parameters/util/useCoreParametersCollapseLabel';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const UnifiedCanvasCoreParameters = () => {
|
const UnifiedCanvasCoreParameters = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
const shouldUseSliders = useAppSelector((state) => state.ui.shouldUseSliders);
|
||||||
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
const { iterationsAndSeedLabel } = useCoreParametersCollapseLabel();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IAICollapse
|
<IAICollapse
|
||||||
label="General"
|
label={t('parameters.general')}
|
||||||
activeLabel={iterationsAndSeedLabel}
|
activeLabel={iterationsAndSeedLabel}
|
||||||
defaultIsOpen={true}
|
defaultIsOpen={true}
|
||||||
>
|
>
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { BoardId } from 'features/gallery/store/types';
|
import { BoardId } from 'features/gallery/store/types';
|
||||||
import { useListAllBoardsQuery } from '../endpoints/boards';
|
import { useListAllBoardsQuery } from '../endpoints/boards';
|
||||||
|
import { t } from 'i18next';
|
||||||
|
|
||||||
export const useBoardName = (board_id: BoardId) => {
|
export const useBoardName = (board_id: BoardId) => {
|
||||||
const { boardName } = useListAllBoardsQuery(undefined, {
|
const { boardName } = useListAllBoardsQuery(undefined, {
|
||||||
selectFromResult: ({ data }) => {
|
selectFromResult: ({ data }) => {
|
||||||
const selectedBoard = data?.find((b) => b.board_id === board_id);
|
const selectedBoard = data?.find((b) => b.board_id === board_id);
|
||||||
const boardName = selectedBoard?.board_name || 'Uncategorized';
|
const boardName = selectedBoard?.board_name || t('boards.uncategorized');
|
||||||
|
|
||||||
return { boardName };
|
return { boardName };
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user