From 66f601343653a5bf3167c65ad0b75e01ac1de16d Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 26 Feb 2024 14:40:38 -0500 Subject: [PATCH] fix literal strings in MM UI --- invokeai/frontend/web/public/locales/en.json | 17 ++++++- .../components/ControlAdapterConfig.tsx | 3 +- .../AddModelPanel/AdvancedImport.tsx | 24 +++++----- .../ScanModels/ScanModelsResults.tsx | 5 ++- .../modelManagerV2/subpanels/ImportModels.tsx | 10 +++-- .../modelManagerV2/subpanels/ModelManager.tsx | 6 ++- .../ModelManagerPanel/ModelTypeFilter.tsx | 6 ++- .../subpanels/ModelPanel/ModelEdit.tsx | 38 ++++++++-------- .../subpanels/ModelPanel/ModelView.tsx | 44 +++++++++++-------- 9 files changed, 90 insertions(+), 63 deletions(-) diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index e13f8b31d1..21a2f6a9fd 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -692,6 +692,7 @@ "addDiffuserModel": "Add Diffusers", "addManually": "Add Manually", "addModel": "Add Model", + "addModels": "Add Models", "addNew": "Add New", "addNewModel": "Add New Model", "addSelected": "Add Selected", @@ -736,6 +737,7 @@ "descriptionValidationMsg": "Add a description for your model", "deselectAll": "Deselect All", "diffusersModels": "Diffusers", + "edit": "Edit", "findModels": "Find Models", "formMessageDiffusersModelLocation": "Diffusers Model Location", "formMessageDiffusersModelLocationDesc": "Please enter at least one.", @@ -744,6 +746,7 @@ "height": "Height", "heightValidationMsg": "Default height of your model.", "ignoreMismatch": "Ignore Mismatches Between Selected Models", + "imageEncoderModelId": "Image Encoder Model ID", "importModels": "Import Models", "importQueue": "Import Queue", "inpainting": "v1 Inpainting", @@ -774,8 +777,11 @@ "modelMergeHeaderHelp1": "You can merge up to three different models to create a blend that suits your needs.", "modelMergeHeaderHelp2": "Only Diffusers are available for merging. If you want to merge a checkpoint model, please convert it to Diffusers first.", "modelMergeInterpAddDifferenceHelp": "In this mode, Model 3 is first subtracted from Model 2. The resulting version is blended with Model 1 with the alpha rate set above.", + "modelMetadata": "Model Metadata", + "modelName": "Model Name", "modelOne": "Model 1", "modelsFound": "Models Found", + "modelSettings": "Model Settings", "modelsMerged": "Models Merged", "modelsMergeFailed": "Model Merge Failed", "modelsSynced": "Models Synced", @@ -795,20 +801,24 @@ "notLoaded": "not loaded", "oliveModels": "Olives", "onnxModels": "Onnx", + "path": "Path", "pathToCustomConfig": "Path To Custom Config", "pickModelType": "Pick Model Type", - "predictionType": "Prediction Type (for Stable Diffusion 2.x Models and occasional Stable Diffusion 1.x Models)", + "predictionType": "Prediction Type", "prune": "Prune", "pruneTooltip": "Prune finished imports from queue", "quickAdd": "Quick Add", "removeFromQueue": "Remove From Queue", "repo_id": "Repo ID", "repoIDValidationMsg": "Online repository of your model", + "repoVariant": "Repo Variant", "safetensorModels": "SafeTensors", "sameFolder": "Same folder", + "scan": "Scan", "scanFolder": "Scan folder", "scanAgain": "Scan Again", "scanForModels": "Scan For Models", + "scanResults": "Scan Results", "search": "Search", "selectAll": "Select All", "selectAndAdd": "Select and Add Models Listed Below", @@ -819,9 +829,11 @@ "showExisting": "Show Existing", "sigmoid": "Sigmoid", "simpleModelDesc": "Provide a path to a local Diffusers model, local checkpoint / safetensors model a HuggingFace Repo ID, or a checkpoint/diffusers model URL.", + "source": "Source", "statusConverting": "Converting", "syncModels": "Sync Models", "syncModelsDesc": "If your models are out of sync with the backend, you can refresh them up using this option. This is generally handy in cases where you add models to the InvokeAI root folder or autoimport directory after the application has booted.", + "upcastAttention": "Upcast Attention", "updateModel": "Update Model", "useCustomConfig": "Use Custom Config", "v1": "v1", @@ -836,7 +848,8 @@ "variant": "Variant", "weightedSum": "Weighted Sum", "width": "Width", - "widthValidationMsg": "Default width of your model." + "widthValidationMsg": "Default width of your model.", + "ztsnrTraining": "ZTSNR Training" }, "models": { "addLora": "Add LoRA", diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx index 6124823808..2497e5b16b 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx @@ -20,7 +20,6 @@ import ControlAdapterShouldAutoConfig from './ControlAdapterShouldAutoConfig'; import ControlNetCanvasImageImports from './imports/ControlNetCanvasImageImports'; import { ParamControlAdapterBeginEnd } from './parameters/ParamControlAdapterBeginEnd'; import ParamControlAdapterControlMode from './parameters/ParamControlAdapterControlMode'; -import ParamControlAdapterModel from './parameters/ParamControlAdapterModel'; import ParamControlAdapterProcessorSelect from './parameters/ParamControlAdapterProcessorSelect'; import ParamControlAdapterResizeMode from './parameters/ParamControlAdapterResizeMode'; import ParamControlAdapterWeight from './parameters/ParamControlAdapterWeight'; @@ -73,7 +72,7 @@ const ControlAdapterConfig = (props: { id: string; number: number }) => { - + {/* */} {activeTabName === 'unifiedCanvas' && } { - Model Type + {t('modelManager.modelType')} control={control} name="type" /> @@ -157,17 +157,17 @@ export const AdvancedImport = () => { - Base Model + {t('modelManager.baseModel')} control={control} name="base" /> - Format + {t('common.format')} control={control} name="format" /> - Path + {t('modelManager.path')} value.trim().length > 0 || 'Must provide a path', @@ -181,39 +181,39 @@ export const AdvancedImport = () => { {watchedModelFormat === 'diffusers' && ( - Repo Variant + {t('modelManager.repoVariant')} control={control} name="repo_variant" /> )} {watchedModelFormat === 'checkpoint' && ( - Config Path + {t('modelManager.pathToConfig')} )} - Variant + {t('modelManager.variant')} control={control} name="variant" /> - Prediction Type + {t('modelManager.predictionType')} control={control} name="prediction_type" /> - Upcast Attention + {t('modelManager.upcastAttention')} control={control} name="upcast_attention" /> - ZTSNR Training + {t('modelManager.ztsnrTraining')} control={control} name="ztsnr_training" /> - VAE Path + {t('modelManager.vaeLocation')} @@ -222,7 +222,7 @@ export const AdvancedImport = () => { {watchedModelType === 'ip_adapter' && ( - Image Encoder Model ID + {t('modelManager.imageEncoderModelId')} diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ScanModels/ScanModelsResults.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ScanModels/ScanModelsResults.tsx index 7a300546b3..cf9439b45d 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ScanModels/ScanModelsResults.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/ScanModels/ScanModelsResults.tsx @@ -1,8 +1,8 @@ import { Divider, Flex, Heading, IconButton, Input, InputGroup, InputRightElement } from '@invoke-ai/ui-library'; import ScrollableContent from 'common/components/OverlayScrollbars/ScrollableContent'; -import { t } from 'i18next'; import type { ChangeEventHandler } from 'react'; import { useCallback, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { PiXBold } from 'react-icons/pi'; import type { ScanFolderResponse } from 'services/api/endpoints/models'; @@ -13,6 +13,7 @@ type ScanModelResultsProps = { }; export const ScanModelsResults = ({ results }: ScanModelResultsProps) => { + const { t } = useTranslation(); const [searchTerm, setSearchTerm] = useState(''); const filteredResults = useMemo(() => { @@ -36,7 +37,7 @@ export const ScanModelsResults = ({ results }: ScanModelResultsProps) => { - Scan Results + {t('modelManager.scanResults')} { + const { t } = useTranslation(); return ( - Add Model + {t('modelManager.addModel')} - Simple - Advanced - Scan + {t('common.simple')} + {t('modelManager.advanced')} + {t('modelManager.scan')} diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManager.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManager.tsx index 012b2ef2e6..2a9b0e382c 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManager.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManager.tsx @@ -3,11 +3,13 @@ import { useAppDispatch } from 'app/store/storeHooks'; import { SyncModelsIconButton } from 'features/modelManagerV2/components/SyncModels/SyncModelsIconButton'; import { setSelectedModelKey } from 'features/modelManagerV2/store/modelManagerV2Slice'; import { useCallback } from 'react'; +import { useTranslation } from 'react-i18next'; import ModelList from './ModelManagerPanel/ModelList'; import { ModelListNavigation } from './ModelManagerPanel/ModelListNavigation'; export const ModelManager = () => { + const { t } = useTranslation(); const dispatch = useAppDispatch(); const handleClickAddModel = useCallback(() => { dispatch(setSelectedModelKey(null)); @@ -17,11 +19,11 @@ export const ModelManager = () => { - Model Manager + {t('common.modelManager')} diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelTypeFilter.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelTypeFilter.tsx index c9592d6102..b58719078f 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelTypeFilter.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelTypeFilter.tsx @@ -2,6 +2,7 @@ import { Button, Menu, MenuButton, MenuItem, MenuList } from '@invoke-ai/ui-libr import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { setFilteredModelType } from 'features/modelManagerV2/store/modelManagerV2Slice'; import { useCallback } from 'react'; +import { useTranslation } from 'react-i18next'; import { IoFilter } from 'react-icons/io5'; export const MODEL_TYPE_LABELS: { [key: string]: string } = { @@ -17,6 +18,7 @@ export const MODEL_TYPE_LABELS: { [key: string]: string } = { }; export const ModelTypeFilter = () => { + const { t } = useTranslation(); const dispatch = useAppDispatch(); const filteredModelType = useAppSelector((s) => s.modelmanagerV2.filteredModelType); @@ -34,10 +36,10 @@ export const ModelTypeFilter = () => { return ( }> - {filteredModelType ? MODEL_TYPE_LABELS[filteredModelType] : 'All Models'} + {filteredModelType ? MODEL_TYPE_LABELS[filteredModelType] : t('modelManager.allModels')} - All Models + {t('modelManager.allModels')} {Object.keys(MODEL_TYPE_LABELS).map((option) => ( { }, [dispatch]); if (isLoading) { - return Loading; + return {t('common.loading')}; } if (!modelData) { - return Something went wrong; + return {t('common.somethingWentWrong')}; } return (
- + value.trim().length > 3 || 'Must be at least 3 characters', @@ -164,7 +164,7 @@ export const ModelEdit = () => { @@ -183,30 +183,30 @@ export const ModelEdit = () => { - Description + {t('modelManager.description')}