From 4d8b8a2db8cec7ed4ba31bd8fdbd4e09102ddc5b Mon Sep 17 00:00:00 2001 From: Rohinish <92542124+rohinish404@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:54:03 +0530 Subject: [PATCH] fix(ui): add missing translations (#5096) * first string only to test * more strings changed * almost half strings added in json file * more strings added * more changes * few strings and t function changed * resolved * errors resolved * chore(ui): fmt en.json --------- Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> --- invokeai/frontend/web/public/locales/en.json | 53 +++++++++++++++--- .../listeners/imageUploaded.ts | 2 +- .../components/ParamDynamicPromptsPreview.tsx | 4 +- .../components/Boards/DeleteBoardModal.tsx | 10 ++-- .../Boards/GalleryBoardContextMenuItems.tsx | 5 +- .../CurrentImage/CurrentImagePreview.tsx | 5 +- .../MultipleSelectionMenuItems.tsx | 2 +- .../SingleSelectionMenuItems.tsx | 4 +- .../lora/components/ParamLoraSelect.tsx | 2 +- .../subpanels/AddModelsPanel/AddModels.tsx | 6 ++- .../AddModelsPanel/AdvancedAddModels.tsx | 15 +++--- .../AddModelsPanel/ScanAdvancedAddModels.tsx | 13 ++++- .../subpanels/MergeModelsPanel.tsx | 2 +- .../subpanels/ModelManagerPanel.tsx | 4 +- .../SyncModelsButton.tsx | 2 +- .../TopRightPanel/WorkflowEditorSettings.tsx | 4 +- .../sidePanel/inspector/InspectorPanel.tsx | 10 ++-- .../sidePanel/workflow/WorkflowPanel.tsx | 6 ++- .../ParamCanvasCoherenceMode.tsx | 18 ++++--- .../Canvas/GenerationModeStatusText.tsx | 24 +++++---- .../Upscale/ParamRealESRGANModel.tsx | 5 +- .../components/QueueList/QueueListHeader.tsx | 11 ++-- .../SettingsModal/SettingsModal.tsx | 6 +-- .../tabs/ModelManager/ModelManagerTab.tsx | 54 ++++++++++--------- .../UnifiedCanvas/UnifiedCanvasContent.tsx | 7 ++- 25 files changed, 180 insertions(+), 94 deletions(-) diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 561b577a46..e3dd84bf5c 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -6,6 +6,7 @@ "flipVertically": "Flip Vertically", "invokeProgressBar": "Invoke progress bar", "menu": "Menu", + "mode": "Mode", "modelSelect": "Model Select", "modifyConfig": "Modify Config", "nextImage": "Next Image", @@ -30,6 +31,10 @@ "cancel": "Cancel", "changeBoard": "Change Board", "clearSearch": "Clear Search", + "deleteBoard": "Delete Board", + "deleteBoardAndImages": "Delete Board and Images", + "deleteBoardOnly": "Delete Board Only", + "deletedBoardsCannotbeRestored": "Deleted boards cannot be restored", "loading": "Loading...", "menuItemAutoAdd": "Auto-add to this Board", "move": "Move", @@ -51,9 +56,12 @@ "cancel": "Cancel", "close": "Close", "on": "On", + "checkpoint": "Checkpoint", "communityLabel": "Community", "controlNet": "ControlNet", "controlAdapter": "Control Adapter", + "data": "Data", + "details": "Details", "ipAdapter": "IP Adapter", "t2iAdapter": "T2I Adapter", "darkMode": "Dark Mode", @@ -65,6 +73,7 @@ "imagePrompt": "Image Prompt", "imageFailedToLoad": "Unable to Load Image", "img2img": "Image To Image", + "inpaint": "inpaint", "langArabic": "العربية", "langBrPortuguese": "Português do Brasil", "langDutch": "Nederlands", @@ -93,6 +102,8 @@ "nodes": "Workflow Editor", "nodesDesc": "A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature.", "openInNewTab": "Open in New Tab", + "outpaint": "outpaint", + "outputs": "Outputs", "postProcessDesc1": "Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer.", "postProcessDesc2": "A dedicated UI will be released soon to facilitate more advanced post processing workflows.", "postProcessDesc3": "The Invoke AI Command Line Interface offers various other features including Embiggen.", @@ -100,7 +111,9 @@ "postProcessing": "Post Processing", "random": "Random", "reportBugLabel": "Report Bug", + "safetensors": "Safetensors", "settingsLabel": "Settings", + "simple": "Simple", "statusConnected": "Connected", "statusConvertingModel": "Converting Model", "statusDisconnected": "Disconnected", @@ -127,6 +140,7 @@ "statusSavingImage": "Saving Image", "statusUpscaling": "Upscaling", "statusUpscalingESRGAN": "Upscaling (ESRGAN)", + "template": "Template", "training": "Training", "trainingDesc1": "A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface.", "trainingDesc2": "InvokeAI already supports training custom embeddourings using Textual Inversion using the main script.", @@ -214,6 +228,7 @@ "setControlImageDimensions": "Set Control Image Dimensions To W/H", "showAdvanced": "Show Advanced", "toggleControlNet": "Toggle this ControlNet", + "unstarImage": "Unstar Image", "w": "W", "weight": "Weight", "enableIPAdapter": "Enable IP Adapter", @@ -279,6 +294,7 @@ "next": "Next", "status": "Status", "total": "Total", + "time": "Time", "pending": "Pending", "in_progress": "In Progress", "completed": "Completed", @@ -286,6 +302,7 @@ "canceled": "Canceled", "completedIn": "Completed in", "batch": "Batch", + "batchFieldValues": "Batch Field Values", "item": "Item", "session": "Session", "batchValues": "Batch Values", @@ -335,6 +352,7 @@ "loading": "Loading", "loadMore": "Load More", "maintainAspectRatio": "Maintain Aspect Ratio", + "noImageSelected": "No Image Selected", "noImagesInGallery": "No Images to Display", "setCurrentImage": "Set as Current Image", "showGenerations": "Show Generations", @@ -583,7 +601,7 @@ "strength": "Image to image strength", "Threshold": "Noise Threshold", "variations": "Seed-weight pairs", - "vae": "VAE", + "vae": "VAE", "width": "Width", "workflow": "Workflow" }, @@ -606,6 +624,7 @@ "cannotUseSpaces": "Cannot Use Spaces", "checkpointFolder": "Checkpoint Folder", "checkpointModels": "Checkpoints", + "checkpointOrSafetensors": "$t(common.checkpoint) / $t(common.safetensors)", "clearCheckpointFolder": "Clear Checkpoint Folder", "closeAdvanced": "Close Advanced", "config": "Config", @@ -685,6 +704,7 @@ "nameValidationMsg": "Enter a name for your model", "noCustomLocationProvided": "No Custom Location Provided", "noModels": "No Models Found", + "noModelSelected": "No Model Selected", "noModelsFound": "No Models Found", "none": "none", "notLoaded": "not loaded", @@ -730,6 +750,8 @@ "widthValidationMsg": "Default width of your model." }, "models": { + "addLora": "Add LoRA", + "esrganModel": "ESRGAN Model", "loading": "loading", "noLoRAsAvailable": "No LoRAs available", "noMatchingLoRAs": "No matching LoRAs", @@ -1010,6 +1032,7 @@ "maskAdjustmentsHeader": "Mask Adjustments", "maskBlur": "Blur", "maskBlurMethod": "Blur Method", + "maskEdge": "Mask Edge", "negativePromptPlaceholder": "Negative Prompt", "noiseSettings": "Noise", "noiseThreshold": "Noise Threshold", @@ -1057,6 +1080,7 @@ "upscale": "Upscale (Shift + U)", "upscaleImage": "Upscale Image", "upscaling": "Upscaling", + "unmasked": "Unmasked", "useAll": "Use All", "useCpuNoise": "Use CPU Noise", "cpuNoise": "CPU Noise", @@ -1078,6 +1102,7 @@ "dynamicPrompts": "Dynamic Prompts", "enableDynamicPrompts": "Enable Dynamic Prompts", "maxPrompts": "Max Prompts", + "promptsPreview": "Prompts Preview", "promptsWithCount_one": "{{count}} Prompt", "promptsWithCount_other": "{{count}} Prompts", "seedBehaviour": { @@ -1117,7 +1142,10 @@ "displayHelpIcons": "Display Help Icons", "displayInProgress": "Display Progress Images", "enableImageDebugging": "Enable Image Debugging", + "enableInformationalPopovers": "Enable Informational Popovers", + "enableInvisibleWatermark": "Enable Invisible Watermark", "enableNodesEditor": "Enable Nodes Editor", + "enableNSFWChecker": "Enable NSFW Checker", "experimental": "Experimental", "favoriteSchedulers": "Favorite Schedulers", "favoriteSchedulersPlaceholder": "No schedulers favorited", @@ -1217,7 +1245,8 @@ "sentToImageToImage": "Sent To Image To Image", "sentToUnifiedCanvas": "Sent to Unified Canvas", "serverError": "Server Error", - "setCanvasInitialImage": "Set as canvas initial image", + "setAsCanvasInitialImage": "Set as canvas initial image", + "setCanvasInitialImage": "Set canvas initial image", "setControlImage": "Set as control image", "setIPAdapterImage": "Set as IP Adapter Image", "setInitialImage": "Set as initial image", @@ -1275,11 +1304,15 @@ }, "compositingBlur": { "heading": "Blur", - "paragraphs": ["The blur radius of the mask."] + "paragraphs": [ + "The blur radius of the mask." + ] }, "compositingBlurMethod": { "heading": "Blur Method", - "paragraphs": ["The method of blur applied to the masked area."] + "paragraphs": [ + "The method of blur applied to the masked area." + ] }, "compositingCoherencePass": { "heading": "Coherence Pass", @@ -1289,7 +1322,9 @@ }, "compositingCoherenceMode": { "heading": "Mode", - "paragraphs": ["The mode of the Coherence Pass."] + "paragraphs": [ + "The mode of the Coherence Pass." + ] }, "compositingCoherenceSteps": { "heading": "Steps", @@ -1307,7 +1342,9 @@ }, "compositingMaskAdjustments": { "heading": "Mask Adjustments", - "paragraphs": ["Adjust the mask."] + "paragraphs": [ + "Adjust the mask." + ] }, "controlNetBeginEnd": { "heading": "Begin / End Step Percentage", @@ -1365,7 +1402,9 @@ }, "infillMethod": { "heading": "Infill Method", - "paragraphs": ["Method to infill the selected area."] + "paragraphs": [ + "Method to infill the selected area." + ] }, "lora": { "heading": "LoRA Weight", diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts index 3cff64f5bb..5b6ed0dfe8 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/imageUploaded.ts @@ -79,7 +79,7 @@ export const addImageUploadedFulfilledListener = () => { dispatch( addToast({ ...DEFAULT_UPLOADED_TOAST, - description: t('toast.setCanvasInitialImage'), + description: t('toast.setAsCanvasInitialImage'), }) ); return; diff --git a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx index 7e64521be2..e0ef4af903 100644 --- a/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx +++ b/invokeai/frontend/web/src/features/dynamicPrompts/components/ParamDynamicPromptsPreview.tsx @@ -17,6 +17,7 @@ import IAIInformationalPopover from 'common/components/IAIInformationalPopover/I import ScrollableContent from 'features/nodes/components/sidePanel/ScrollableContent'; import { memo } from 'react'; import { FaCircleExclamation } from 'react-icons/fa6'; +import { useTranslation } from 'react-i18next'; const selector = createSelector( stateSelector, @@ -38,6 +39,7 @@ const listItemStyles: ChakraProps['sx'] = { }; const ParamDynamicPromptsPreview = () => { + const { t } = useTranslation(); const { prompts, parsingError, isLoading, isError } = useAppSelector(selector); @@ -69,7 +71,7 @@ const ParamDynamicPromptsPreview = () => { overflow="hidden" textOverflow="ellipsis" > - Prompts Preview ({prompts.length}) + {t('dynamicPrompts.promptsPreview')} ({prompts.length}) {parsingError && ` - ${parsingError}`} { - Delete {boardToDelete.board_name} + {t('controlnet.delete')} {boardToDelete.board_name} @@ -136,7 +136,7 @@ const DeleteBoardModal = (props: Props) => { bottomMessage={t('boards.bottomMessage')} /> )} - Deleted boards cannot be restored. + {t('boards.deletedBoardsCannotbeRestored')} {canRestoreDeletedImagesFromBin ? t('gallery.deleteImageBin') @@ -149,21 +149,21 @@ const DeleteBoardModal = (props: Props) => { sx={{ justifyContent: 'space-between', width: 'full', gap: 2 }} > - Cancel + {t('boards.cancel')} - Delete Board Only + {t('boards.deleteBoardOnly')} - Delete Board and Images + {t('boards.deleteBoardAndImages')} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx index 9499e6be98..0ce736da5d 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx @@ -2,13 +2,14 @@ import { MenuItem } from '@chakra-ui/react'; import { memo, useCallback } from 'react'; import { FaTrash } from 'react-icons/fa'; import { BoardDTO } from 'services/api/types'; - +import { useTranslation } from 'react-i18next'; type Props = { board: BoardDTO; setBoardToDelete?: (board?: BoardDTO) => void; }; const GalleryBoardContextMenuItems = ({ board, setBoardToDelete }: Props) => { + const { t } = useTranslation(); const handleDelete = useCallback(() => { if (!setBoardToDelete) { return; @@ -34,7 +35,7 @@ const GalleryBoardContextMenuItems = ({ board, setBoardToDelete }: Props) => { icon={} onClick={handleDelete} > - Delete Board + {t('boards.deleteBoard')} ); diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx index ec60d7cbef..f755de269c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx @@ -170,7 +170,10 @@ const CurrentImagePreview = () => { useThumbailFallback dropLabel={t('gallery.setCurrentImage')} noContentFallback={ - + } dataTestId="image-preview" /> diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx index 675a4fd6af..a067050290 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx @@ -104,7 +104,7 @@ const MultipleSelectionMenuItems = () => { )} } onClickCapture={handleChangeBoard}> - Change Board + {t('boards.changeBoard')} { )} } onClickCapture={handleChangeBoard}> - Change Board + {t('boards.changeBoard')} {imageDTO.starred ? ( } onClickCapture={handleUnstarImage} > - {customStarUi ? customStarUi.off.text : `Unstar Image`} + {customStarUi ? customStarUi.off.text : t('controlnet.unstarImage')} ) : ( { return ( ( 'simple' ); @@ -27,14 +29,14 @@ export default function AddModels() { isChecked={addModelMode == 'simple'} onClick={handleAddModelSimple} > - Simple + {t('common.simple')} - Advanced + {t('common.advanced')} [ + { label: t('modelManager.diffusersModels'), value: 'diffusers' }, + { label: t('modelManager.checkpointOrSafetensors'), value: 'checkpoint' }, + ], + [t] + ); + return ( [ + { label: t('modelManager.diffusersModels'), value: 'diffusers' }, + { label: t('modelManager.checkpointOrSafetensors'), value: 'checkpoint' }, + ], + [t] + ); + const [advancedAddMode, setAdvancedAddMode] = useState('diffusers'); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx index f9132517c2..f2bb9bc83d 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx @@ -227,7 +227,7 @@ export default function MergeModelsPanel() { (); @@ -45,6 +46,7 @@ type ModelEditProps = { }; const ModelEdit = (props: ModelEditProps) => { + const { t } = useTranslation(); const { model } = props; if (model?.model_format === 'checkpoint') { @@ -75,7 +77,7 @@ const ModelEdit = (props: ModelEditProps) => { userSelect: 'none', }} > - No Model Selected + {t('modelManager.noModelSelected')} ); }; diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx index c58abaaae5..8ff9db741f 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx @@ -54,7 +54,7 @@ export default function SyncModelsButton(props: SyncModelsButtonProps) { minW="max-content" {...rest} > - Sync Models + {t('modelManager.syncModels')} ) : ( { py: 4, }} > - General + {t('parameters.general')} { helperText={t('nodes.fullyContainNodesHelp')} /> - Advanced + {t('common.advanced')} { + const { t } = useTranslation(); return ( { sx={{ display: 'flex', flexDir: 'column', w: 'full', h: 'full' }} > - Details - Outputs - Data - Template + {t('common.details')} + {t('common.outputs')} + {t('common.data')} + {t('common.template')} diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx index 4cf7b2e431..925d9e8d6d 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx @@ -10,8 +10,10 @@ import { memo } from 'react'; import WorkflowGeneralTab from './WorkflowGeneralTab'; import WorkflowJSONTab from './WorkflowJSONTab'; import WorkflowLinearTab from './WorkflowLinearTab'; +import { useTranslation } from 'react-i18next'; const WorkflowPanel = () => { + const { t } = useTranslation(); return ( { sx={{ display: 'flex', flexDir: 'column', w: 'full', h: 'full' }} > - Linear - Details + {t('common.linear')} + {t('common.details')} JSON diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx index eff94284e4..1196719af3 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/Compositing/CoherencePass/ParamCanvasCoherenceMode.tsx @@ -5,16 +5,9 @@ import { IAISelectDataType } from 'common/components/IAIMantineSearchableSelect' import IAIMantineSelect from 'common/components/IAIMantineSelect'; import { setCanvasCoherenceMode } from 'features/parameters/store/generationSlice'; import { CanvasCoherenceModeParam } from 'features/parameters/types/parameterSchemas'; - -import { memo, useCallback } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -const coherenceModeSelectData: IAISelectDataType[] = [ - { label: 'Unmasked', value: 'unmasked' }, - { label: 'Mask', value: 'mask' }, - { label: 'Mask Edge', value: 'edge' }, -]; - const ParamCanvasCoherenceMode = () => { const dispatch = useAppDispatch(); const canvasCoherenceMode = useAppSelector( @@ -22,6 +15,15 @@ const ParamCanvasCoherenceMode = () => { ); const { t } = useTranslation(); + const coherenceModeSelectData: IAISelectDataType[] = useMemo( + () => [ + { label: t('parameters.unmasked'), value: 'unmasked' }, + { label: t('unifiedCanvas.mask'), value: 'mask' }, + { label: t('parameters.maskEdge'), value: 'edge' }, + ], + [t] + ); + const handleCoherenceModeChange = useCallback( (v: string | null) => { if (!v) { diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/GenerationModeStatusText.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/GenerationModeStatusText.tsx index eeef340324..7d99e66220 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/GenerationModeStatusText.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Canvas/GenerationModeStatusText.tsx @@ -1,20 +1,26 @@ import { Box } from '@chakra-ui/react'; import { useCanvasGenerationMode } from 'features/canvas/hooks/useCanvasGenerationMode'; -import { memo } from 'react'; - -const GENERATION_MODE_NAME_MAP = { - txt2img: 'Text to Image', - img2img: 'Image to Image', - inpaint: 'Inpaint', - outpaint: 'Inpaint', -}; +import { memo, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; const GenerationModeStatusText = () => { const generationMode = useCanvasGenerationMode(); + const { t } = useTranslation(); + + const GENERATION_MODE_NAME_MAP = useMemo( + () => ({ + txt2img: t('common.txt2img'), + img2img: t('common.img2img'), + inpaint: t('common.inpaint'), + outpaint: t('common.outpaint'), + }), + [t] + ); return ( - Mode: {generationMode ? GENERATION_MODE_NAME_MAP[generationMode] : '...'} + {t('accessibility.mode')}:{' '} + {generationMode ? GENERATION_MODE_NAME_MAP[generationMode] : '...'} ); }; diff --git a/invokeai/frontend/web/src/features/parameters/components/Parameters/Upscale/ParamRealESRGANModel.tsx b/invokeai/frontend/web/src/features/parameters/components/Parameters/Upscale/ParamRealESRGANModel.tsx index 8a5ac94fac..0885197040 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Parameters/Upscale/ParamRealESRGANModel.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Parameters/Upscale/ParamRealESRGANModel.tsx @@ -7,6 +7,7 @@ import { ESRGANModelName, esrganModelNameChanged, } from 'features/parameters/store/postprocessingSlice'; +import { useTranslation } from 'react-i18next'; import { useCallback } from 'react'; export const ESRGAN_MODEL_NAMES: SelectItem[] = [ @@ -37,6 +38,8 @@ export const ESRGAN_MODEL_NAMES: SelectItem[] = [ ]; export default function ParamESRGANModel() { + const { t } = useTranslation(); + const esrganModelName = useAppSelector( (state: RootState) => state.postprocessing.esrganModelName ); @@ -50,7 +53,7 @@ export default function ParamESRGANModel() { return ( { + const { t } = useTranslation(); return ( { # - status + {t('queue.status')} - time + {t('queue.time')} - batch + {t('queue.batch')} - batch field values + {t('queue.batchFieldValues')} ); diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx index fdfe3fb0ce..79fb7807a5 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx @@ -298,13 +298,13 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => { {t('settings.generation')} { /> )} diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/ModelManagerTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/ModelManagerTab.tsx index 50a9b3b581..903fbece52 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/ModelManagerTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/ModelManagerTab.tsx @@ -1,6 +1,6 @@ import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'; -import i18n from 'i18n'; -import { ReactNode, memo } from 'react'; +import { ReactNode, memo, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; import ImportModelsPanel from '../../../../modelManager/subpanels/ImportModelsPanel'; import MergeModelsPanel from '../../../../modelManager/subpanels/MergeModelsPanel'; import ModelManagerPanel from '../../../../modelManager/subpanels/ModelManagerPanel'; @@ -18,30 +18,34 @@ type ModelManagerTabInfo = { content: ReactNode; }; -const tabs: ModelManagerTabInfo[] = [ - { - id: 'modelManager', - label: i18n.t('modelManager.modelManager'), - content: , - }, - { - id: 'importModels', - label: i18n.t('modelManager.importModels'), - content: , - }, - { - id: 'mergeModels', - label: i18n.t('modelManager.mergeModels'), - content: , - }, - { - id: 'settings', - label: i18n.t('modelManager.settings'), - content: , - }, -]; - const ModelManagerTab = () => { + const { t } = useTranslation(); + + const tabs: ModelManagerTabInfo[] = useMemo( + () => [ + { + id: 'modelManager', + label: t('modelManager.modelManager'), + content: , + }, + { + id: 'importModels', + label: t('modelManager.importModels'), + content: , + }, + { + id: 'mergeModels', + label: t('modelManager.mergeModels'), + content: , + }, + { + id: 'settings', + label: t('modelManager.settings'), + content: , + }, + ], + [t] + ); return ( { + const { t } = useTranslation(); const { isOver, setNodeRef: setDroppableRef, @@ -40,7 +42,10 @@ const UnifiedCanvasContent = () => { {isValidDrop(droppableData, active) && ( - + )} );