Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(ui): translate remaining model manager strings

Josh Corbettde5d95c71d15
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index 3e71738796..c015370f69 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -239,6 +239,7 @@
"pending": "Pending"
},
"total": "Total",
+ "unknownError": "Unknown error.",
"unknownTime": "Unknown time",
"view": "View",
"viewJson": "View JSON",
@@ -812,6 +813,7 @@
"addModelsResults": "Add models results",
"addTriggerPhrase": "Add a trigger phrase...",
"allBases": "All bases",
+ "allInstalled": "all installed",
"allModels": "All models",
"apiKey": "API key",
"apiKeyConfigured": "API key configured",
@@ -841,13 +843,18 @@
"civitaiKeyPlaceholder": "32-character key from civitai.com/user/account",
"cleanupOrphaned": "Clean up orphaned models…",
"clearFinished": "Clear finished",
+ "clearSelectedModel": "Clear selected model",
"clearSelection": "Clear selection",
+ "compactRows": "Compact rows",
+ "conversionFailed": "Conversion failed",
"convert": "Convert",
"convertBody": "Convert \"{{name}}\" to the diffusers format in place? The original checkpoint file is replaced by a diffusers folder.",
"convertToDiffusers": "Convert to diffusers",
+ "convertedToDiffusers": "Converted to diffusers",
"couldNotLoad": "Could not load models",
"couldNotLoadInstallQueue": "Could not load the install queue",
"couldNotLoadStarterModels": "Could not load starter models",
+ "countToInstall": "{{count}} to install",
"customizeDefaultField": "Customize {{field}} for this model",
"customizedForThisModel": "Customized for this model",
"defaultFieldInherited": {
@@ -880,6 +887,7 @@
"defaultSettingsHelp": "Applied automatically when this model is selected. Off = use the app default.",
"defaultSettingsSaved": "Default settings saved",
"deleteBody": "Delete \"{{name}}\"? The database record is removed, and the model files are deleted if they live inside the InvokeAI models directory.",
+ "deleteFailed": "Delete failed",
"deleteModel": "Delete model",
"deleteSelectedTitle": "Delete selected models",
"deleteSelectedWithBytes": "Delete Selected ({{bytes}})",
@@ -899,6 +907,7 @@
"failedToEmptyCache": "Failed to empty model cache",
"failedToLinkModels": "Failed to link models.",
"failedToLoadExternalProviders": "Failed to load external providers.",
+ "failedToLoadModels": "Failed to load models.",
"failedToLoadRelatedModels": "Failed to load related models.",
"failedToRemoveModelImage": "Failed to remove model image.",
"failedToSaveDefaults": "Failed to save default settings.",
@@ -917,12 +926,15 @@
"filterAndSortStarterModels": "Filter and sort starter models",
"filterFiles": "Filter files",
"filterResults": "Filter results",
+ "fullRows": "Full rows",
"hash": "Hash",
"huggingFaceKeyDescription": "For gated repos like FLUX. Stored on the InvokeAI server and verified with HuggingFace.",
"huggingFaceRejectedToken": "HuggingFace rejected this token. Check that it has read access.",
"huggingFaceToken": "HuggingFace token",
+ "install": "Install",
"installAll": "Install all",
"installAllCount": "Install all ({{count}})",
+ "installBundle": "Install bundle",
"installFailed": "Install failed",
"installInPlace": "Install in place",
"installJobSummary_one": "{{count}} job · no active installs",
@@ -930,6 +942,7 @@
"installJobs": "Install jobs",
"installQueue": "Install Queue",
"installed": "Installed",
+ "installing": "Installing",
"installsDependencies_one": " (installs {{count}} dependency)",
"installsDependencies_other": " (installs {{count}} dependencies)",
"invalidDefaultSettings": "Invalid default settings.",
@@ -950,16 +963,30 @@
},
"library": "Model library",
"libraryMaintenance": "Model library maintenance",
+ "linkedModel": "Linked model",
+ "linkedToCurrentSelection": "Linked to the current selection",
+ "loadingModels": "Loading models…",
"manageApiKeys": "Manage API keys",
+ "manageModels": "Manage models",
"manager": "Model Manager",
+ "missingFile": "Missing file",
"missingFilesCount": "Missing files ({{count}})",
"modelAndDependenciesQueued_one": "{{name}} and {{count}} dependency",
"modelAndDependenciesQueued_other": "{{name}} and {{count}} dependencies",
+ "modelCount_one": "{{count}} model",
+ "modelCount_other": "{{count}} models",
"modelCoverAlt": "{{name}} cover",
+ "modelDeleted": "Model deleted",
"modelImage": "Model image",
"modelImageUpdated": "Model image updated",
+ "modelInstallCancelled": "Model install cancelled",
+ "modelInstallFailed": "Model install failed",
+ "modelInstallFailedToStart": "Model install failed to start",
"modelInstallQueued": "Model install queued",
+ "modelInstalled": "Model installed",
"modelManager": "Model manager",
+ "modelNoLongerInLibrary": "This model is no longer in the library.",
+ "modelReidentified": "Model re-identified",
"modelType": "Model Type",
"modelUpdated": "Model updated",
"noInstallableModelFiles": "This HuggingFace repo has no installable model files.",
@@ -971,6 +998,7 @@
"noRelatedModels": "No related models linked yet.",
"noStarterModelsPull": "No starter models match - press Pull to install the source you entered.",
"noStarterModelsSearch": "No starter models match your search.",
+ "noTriggerPhrasesYet": "No trigger phrases yet.",
"noneInstalled": "No models installed",
"noneInstalledDescription": "Use Add Models to install your first model.",
"noneMatchFilters": "No models match your filters",
@@ -997,11 +1025,13 @@
"queueActionFailed": "Queue action failed",
"refreshList": "Refresh model list",
"reidentify": "Re-identify model",
+ "reidentifyFailed": "Re-identify failed",
"relatedModels": "Related Models",
"relatedModelsHelp": "Link the models that pair well with this one - they are suggested together elsewhere in the app.",
"removeImage": "Remove image",
"removeModelImage": "Remove model image",
"removeTriggerPhrase": "Remove trigger phrase {{phrase}}",
+ "resetBaseFilters": "Reset base filters",
"restartFile": "Restart file",
"restartFileFailed": "Restart file failed",
"restartThisFile": "Restart this file",
@@ -1022,6 +1052,13 @@
"scanFolderTooltip": "Scan this folder for model files",
"scanSummary_one": "{{count}} file in {{path}} · {{notInstalled}} not installed",
"scanSummary_other": "{{count}} files in {{path}} · {{notInstalled}} not installed",
+ "scopeAvailable": "Available {{scope}}",
+ "scopeModels": "models",
+ "scopeNoCompatibleInstalled": "No compatible {{scope}} installed.",
+ "scopeNoMatchBases": "No {{scope}} match the selected bases.",
+ "scopeNoMatchSearch": "No {{scope}} match your search.",
+ "scopeSearch": "Search {{scope}}…",
+ "scopeSelect": "Select {{scope}}…",
"searchCompatibleToLink": "Search compatible models to link...",
"searchModels": "Search models",
"searchModelsPlaceholder": "Search models…",
@@ -1044,6 +1081,11 @@
"source": "Source",
"sourceUrl": "Source URL",
"sourceUrlHelp": "Model page or download URL.",
+ "statusCancelled": "Cancelled",
+ "statusDownloaded": "Downloaded",
+ "statusDownloading": "Downloading",
+ "statusPaused": "Paused",
+ "statusWaiting": "Waiting",
"title": "Models",
"toFindModelsInFolder": "to find models in this folder.",
"toInstallFrom": "to install from {{source}}.",
@@ -1058,6 +1100,7 @@
"vaeCpuSettingSaved": "VAE CPU setting saved",
"variant": "Variant",
"variantHelp": "Architecture variant, e.g. inpaint or dev.",
+ "viewQueue": "View queue",
"waitingForDownload": "Waiting for download"
},
"nodes": {
diff --git a/invokeai/frontend/webv2/src/features/models/ui/add-models/SelectedBundleBar.tsx b/invokeai/frontend/webv2/src/features/models/ui/add-models/SelectedBundleBar.tsx
index ac6f7694a3..b35192707c 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/add-models/SelectedBundleBar.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/add-models/SelectedBundleBar.tsx
@@ -3,6 +3,7 @@ import type { StarterModelBundle } from '@features/models/core/types';
import { HStack, Icon, Text } from '@chakra-ui/react';
import { Button } from '@platform/ui';
import { DownloadIcon } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
/** Summary + install action for the currently selected bundle. */
export const SelectedBundleBar = ({
@@ -14,18 +15,19 @@ export const SelectedBundleBar = ({
isInstalling: boolean;
onInstall: () => void;
}) => {
+ const { t } = useTranslation();
const missingCount = bundle.models.filter((model) => !model.is_installed).length;
return (
<HStack gap="2" justify="space-between" px="3">
<Text color="fg.subtle" fontSize="2xs" truncate>
- {bundle.name} · {bundle.models.length} models ·{' '}
- {missingCount === 0 ? 'all installed' : `${missingCount} to install`}
+ {bundle.name} · {t('models.modelCount', { count: bundle.models.length })} ·{' '}
+ {missingCount === 0 ? t('models.allInstalled') : t('models.countToInstall', { count: missingCount })}
</Text>
{missingCount > 0 ? (
<Button flexShrink={0} loading={isInstalling} size="2xs" variant="outline" onClick={onInstall}>
<Icon as={DownloadIcon} boxSize="3" />
- Install bundle
+ {t('models.installBundle')}
</Button>
) : null}
</HStack>
diff --git a/invokeai/frontend/webv2/src/features/models/ui/add-models/useInstallActions.ts b/invokeai/frontend/webv2/src/features/models/ui/add-models/useInstallActions.ts
index 9be030c808..a32a1a1888 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/add-models/useInstallActions.ts
+++ b/invokeai/frontend/webv2/src/features/models/ui/add-models/useInstallActions.ts
@@ -8,6 +8,7 @@ import {
isAccountScopeCurrent,
} from '@platform/state/accountLifecycle';
import { useCallback, useState } from 'react';
+import { useTranslation } from 'react-i18next';
/**
* Shared install entry point: queues an install job, optimistically adds it to
@@ -17,6 +18,7 @@ import { useCallback, useState } from 'react';
* of a toast per model; failures always notify.
*/
export const useInstallActions = () => {
+ const { t } = useTranslation();
const notify = useNotify();
const [pendingSources, setPendingSources] = useState<ReadonlySet<string>>(new Set());
@@ -39,7 +41,7 @@ export const useInstallActions = () => {
addInstallJob(job);
if (!options?.silent) {
- notify.success('Model install queued', request.source);
+ notify.success(t('models.modelInstallQueued'), request.source);
}
return true;
@@ -48,7 +50,7 @@ export const useInstallActions = () => {
return false;
}
- notify.error('Model install failed to start', error instanceof Error ? error.message : String(error));
+ notify.error(t('models.modelInstallFailedToStart'), error instanceof Error ? error.message : String(error));
return false;
} finally {
@@ -63,7 +65,7 @@ export const useInstallActions = () => {
}
}
},
- [notify]
+ [notify, t]
);
return { install, pendingSources };
diff --git a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.browser.test.tsx b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.browser.test.tsx
index e6c9d03f51..300875dbf6 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.browser.test.tsx
@@ -10,6 +10,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { ModelSelect } from './ModelSelect';
+// Browser tests run without an i18n provider, so translated copy renders as
+// the raw key (e.g. 'models.compactRows'); assertions below match the keys.
+vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));
+
(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
const model = {
@@ -140,16 +144,16 @@ describe('ModelSelect loading states', () => {
setModelsSnapshotForTests({ error: null, models: [model, secondSdxlModel], status: 'loaded' });
await renderPicker({ id: 'test-compact' });
- const toggle = document.querySelector<HTMLButtonElement>('button[aria-label="Compact rows"]')!;
+ const toggle = document.querySelector<HTMLButtonElement>('button[aria-label="models.compactRows"]')!;
expect(toggle).not.toBeNull();
await act(() => toggle.click());
- await expect.poll(() => document.querySelector('button[aria-label="Full rows"]')).not.toBeNull();
+ await expect.poll(() => document.querySelector('button[aria-label="models.fullRows"]')).not.toBeNull();
// Close and reopen: the preference is stored per picker id, not per mount.
await act(() => host.querySelector<HTMLButtonElement>('[aria-haspopup="listbox"]')?.click());
await act(() => host.querySelector<HTMLButtonElement>('[aria-haspopup="listbox"]')?.click());
- await expect.poll(() => document.querySelector('button[aria-label="Full rows"]')).not.toBeNull();
+ await expect.poll(() => document.querySelector('button[aria-label="models.fullRows"]')).not.toBeNull();
});
});
diff --git a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx
index 40f76650b1..91054c495f 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/components/ModelSelect.tsx
@@ -27,6 +27,7 @@ import {
XIcon,
} from 'lucide-react';
import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
const EMPTY_BASES: ReadonlySet<string> = new Set();
const EMPTY_KEYS: ReadonlySet<string> = new Set();
@@ -62,6 +63,7 @@ export const ModelSelect = ({
size?: 'xs' | 'sm' | 'md';
value: string | null;
}) => {
+ const { t } = useTranslation();
const { enableModelDescriptions } = useModelsUi();
const models = useModelsSelector((snapshot) => snapshot.models);
const loadError = useModelsSelector((snapshot) => snapshot.error);
@@ -117,19 +119,19 @@ export const ModelSelect = ({
const selectedModel = useMemo(() => models.find((model) => model.key === value) ?? null, [models, value]);
const hasMixedTypes = useMemo(() => new Set(candidates.map((model) => model.type)).size > 1, [candidates]);
const scopeLabel =
- modelTypes.length === 1 ? getModelTypePluralLabel(modelTypes[0] ?? 'main').toLowerCase() : 'models';
+ modelTypes.length === 1 ? getModelTypePluralLabel(modelTypes[0] ?? 'main').toLowerCase() : t('models.scopeModels');
const pickerGroups = useMemo<PickerGroup<ModelConfig>[]>(
() =>
groups.map((group) => ({
colorPalette: getModelBaseColorPalette(group.base),
- getCountLabel: (count) => `${count} ${count === 1 ? 'model' : 'models'}`,
+ getCountLabel: (count) => t('models.modelCount', { count }),
id: group.key,
name: getModelBaseLongLabel(group.base),
options: group.models,
shortName: getModelBaseLabel(group.base),
})),
- [groups]
+ [groups, t]
);
const closeAndReset = () => {
@@ -224,7 +226,7 @@ export const ModelSelect = ({
<ModelButtonContent model={selectedModel} />
) : (
<Text as="span" color="fg.subtle" fontSize="xs" minW="0" truncate>
- {placeholder ?? `Select ${scopeLabel}…`}
+ {placeholder ?? t('models.scopeSelect', { scope: scopeLabel })}
</Text>
)}
{canClear ? null : <Icon as={ChevronDownIcon} boxSize="3" flexShrink={0} />}
@@ -232,7 +234,7 @@ export const ModelSelect = ({
</Popover.Trigger>
{canClear ? (
<CloseButton
- aria-label="Clear selected model"
+ aria-label={t('models.clearSelectedModel')}
disabled={disabled}
insetEnd="1"
position="absolute"
@@ -264,19 +266,19 @@ export const ModelSelect = ({
p="0"
>
<Picker<ModelConfig>
- emptyMessage={`No compatible ${scopeLabel} installed.`}
+ emptyMessage={t('models.scopeNoCompatibleInstalled', { scope: scopeLabel })}
getOptionId={getOptionId}
groups={pickerGroups}
isCompact={isCompact}
isMatch={matchesModel}
- listLabel={`Available ${scopeLabel}`}
+ listLabel={t('models.scopeAvailable', { scope: scopeLabel })}
noMatchesMessage={
selectedBases.size > 0
- ? `No ${scopeLabel} match the selected bases.`
- : `No ${scopeLabel} match your search.`
+ ? t('models.scopeNoMatchBases', { scope: scopeLabel })
+ : t('models.scopeNoMatchSearch', { scope: scopeLabel })
}
renderOption={renderOption}
- searchPlaceholder={`Search ${scopeLabel}…`}
+ searchPlaceholder={t('models.scopeSearch', { scope: scopeLabel })}
searchSlot={
<>
<CompactViewToggle isCompact={isCompact} pickerId={pickerId} />
@@ -287,20 +289,20 @@ export const ModelSelect = ({
statusSlot={
loadStatus === 'idle' || loadStatus === 'loading' ? (
<Text color="fg.subtle" fontSize="2xs" p="2">
- Loading models…
+ {t('models.loadingModels')}
</Text>
) : loadStatus === 'error' ? (
<Stack alignItems="start" gap="1.5" p="2">
<Text color="fg.error" fontSize="2xs">
- {loadError ?? 'Failed to load models.'}
+ {loadError ?? t('models.failedToLoadModels')}
</Text>
<Button size="2xs" variant="outline" onClick={() => void ensureModelsLoaded()}>
- Retry
+ {t('common.retry')}
</Button>
</Stack>
) : candidates.length === 0 ? (
<Text color="fg.subtle" fontSize="2xs" p="2">
- No compatible {scopeLabel} installed.
+ {t('models.scopeNoCompatibleInstalled', { scope: scopeLabel })}
</Text>
) : undefined
}
@@ -312,7 +314,7 @@ export const ModelSelect = ({
))}
<Spacer />
<IconButton
- aria-label="Reset base filters"
+ aria-label={t('models.resetBaseFilters')}
flexShrink={0}
opacity={selectedBases.size === 0 ? 0.5 : undefined}
pointerEvents={selectedBases.size === 0 ? 'none' : undefined}
@@ -343,7 +345,8 @@ const matchesModel = (model: ModelConfig, searchTerm: string): boolean => {
};
const CompactViewToggle = ({ isCompact, pickerId }: { isCompact: boolean; pickerId: string }) => {
- const label = isCompact ? 'Full rows' : 'Compact rows';
+ const { t } = useTranslation();
+ const label = isCompact ? t('models.fullRows') : t('models.compactRows');
const handleClick = useCallback(() => setPickerCompactView(pickerId, !isCompact), [isCompact, pickerId]);
return (
@@ -363,12 +366,13 @@ const CompactViewToggle = ({ isCompact, pickerId }: { isCompact: boolean; picker
};
const ModelManagerLinkButton = () => {
+ const { t } = useTranslation();
const { managerProjectId } = useModelsUi();
const search = useMemo(() => ({ project: managerProjectId ?? undefined }), [managerProjectId]);
return (
- <Tooltip content="Manage models" showArrow>
- <IconButton aria-label="Manage models" asChild flexShrink={0} size="xs" variant="ghost">
+ <Tooltip content={t('models.manageModels')} showArrow>
+ <IconButton aria-label={t('models.manageModels')} asChild flexShrink={0} size="xs" variant="ghost">
<Link search={search} to="/models">
<BoxIcon />
</Link>
@@ -443,6 +447,7 @@ const ModelOptionContent = ({
showType: boolean;
state: PickerOptionState;
}) => {
+ const { t } = useTranslation();
const showDetail = !state.isCompact;
return (
@@ -461,8 +466,14 @@ const ModelOptionContent = ({
<Stack flex="1" gap="0" minW="0">
<HStack gap="1.5" minW="0">
{isRelated ? (
- <Tooltip content="Linked to the current selection">
- <Icon as={LinkIcon} aria-label="Linked model" boxSize="3" color="accent.solid" flexShrink={0} />
+ <Tooltip content={t('models.linkedToCurrentSelection')}>
+ <Icon
+ as={LinkIcon}
+ aria-label={t('models.linkedModel')}
+ boxSize="3"
+ color="accent.solid"
+ flexShrink={0}
+ />
</Tooltip>
) : null}
<Text fontSize="xs" minW="0" truncate>
diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelBadges.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelBadges.tsx
index e095a2234a..3545dc1fb3 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelBadges.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelBadges.tsx
@@ -3,6 +3,7 @@ import type { ModelConfig } from '@features/models/core/types';
import { Badge } from '@chakra-ui/react';
import { getModelBaseColorPalette, getModelBaseLabel } from '@features/models/core/baseIdentity';
import { getModelFormatLabel } from '@features/models/core/taxonomy';
+import { useTranslation } from 'react-i18next';
export const ModelBaseBadge = ({ base }: { base: ModelConfig['base'] }) => (
<Badge colorPalette={getModelBaseColorPalette(base)} flexShrink={0} fontSize="2xs" size="sm" variant="surface">
@@ -16,8 +17,12 @@ export const ModelFormatBadge = ({ format }: { format: ModelConfig['format'] })
</Badge>
);
-export const MissingFileBadge = () => (
- <Badge colorPalette="red" flexShrink={0} fontSize="2xs" size="sm" variant="surface">
- Missing file
- </Badge>
-);
+export const MissingFileBadge = () => {
+ const { t } = useTranslation();
+
+ return (
+ <Badge colorPalette="red" flexShrink={0} fontSize="2xs" size="sm" variant="surface">
+ {t('models.missingFile')}
+ </Badge>
+ );
+};
diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx
index f085f84024..a31e2189c3 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx
@@ -121,6 +121,7 @@ export const ModelDetail = ({
onBack?: () => void;
onDeleted: () => void;
}) => {
+ const { t } = useTranslation();
const model = useModelsSelector((snapshot) => selectModelShell(snapshot.models, modelKey));
if (!model) {
@@ -128,7 +129,7 @@ export const ModelDetail = ({
<Stack align="start" gap="2" p="1">
{onBack ? <BackButton onBack={onBack} /> : null}
<Text color="fg.subtle" fontSize="xs">
- This model is no longer in the library.
+ {t('models.modelNoLongerInLibrary')}
</Text>
</Stack>
);
diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/TriggerPhrasesEditor.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/TriggerPhrasesEditor.tsx
index 4abd72579e..ca9fd912ac 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/detail/TriggerPhrasesEditor.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/TriggerPhrasesEditor.tsx
@@ -150,7 +150,7 @@ export const TriggerPhrasesEditor = ({
</Wrap>
) : (
<Text color="fg.subtle" fontSize="2xs">
- No trigger phrases yet.
+ {t('models.noTriggerPhrasesYet')}
</Text>
)}
</Field>
diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/useModelActions.ts b/invokeai/frontend/webv2/src/features/models/ui/detail/useModelActions.ts
index f726afd045..10c07d1778 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/detail/useModelActions.ts
+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/useModelActions.ts
@@ -8,6 +8,7 @@ import { pruneModelsUiKeys } from '@features/models/ui/uiStore';
import { useNotify } from '@features/models/ui/useModelsNotify';
import { assertAccountScopeCurrent } from '@platform/state/accountLifecycle';
import { useCallback } from 'react';
+import { useTranslation } from 'react-i18next';
/**
* Lifecycle actions for a single model, shared by the detail page and the
@@ -17,6 +18,7 @@ import { useCallback } from 'react';
type ModelActionTarget = Pick<ModelConfig, 'key' | 'name'>;
export const useModelActions = () => {
+ const { t } = useTranslation();
const notify = useNotify();
// None of these actions surface a busy flag, so one shared instance's `run`
// covers all three and its isBusy is simply ignored.
@@ -32,11 +34,11 @@ export const useModelActions = () => {
removeModelsFromStore([model.key]);
removeModelsFromRelationships([model.key]);
pruneModelsUiKeys([model.key]);
- notify.success('Model deleted', model.name);
+ notify.success(t('models.modelDeleted'), model.name);
},
- (message) => notify.error('Delete failed', message)
+ (message) => notify.error(t('models.deleteFailed'), message)
),
- [notify, run]
+ [notify, run, t]
);
const convert = useCallback(
@@ -47,11 +49,11 @@ export const useModelActions = () => {
assertAccountScopeCurrent(owner);
replaceModelInStore(converted);
- notify.success('Converted to diffusers', model.name);
+ notify.success(t('models.convertedToDiffusers'), model.name);
},
- (message) => notify.error('Conversion failed', message)
+ (message) => notify.error(t('models.conversionFailed'), message)
),
- [notify, run]
+ [notify, run, t]
);
const reidentify = useCallback(
@@ -62,11 +64,11 @@ export const useModelActions = () => {
assertAccountScopeCurrent(owner);
replaceModelInStore(identified);
- notify.success('Model re-identified', model.name);
+ notify.success(t('models.modelReidentified'), model.name);
},
- (message) => notify.error('Re-identify failed', message)
+ (message) => notify.error(t('models.reidentifyFailed'), message)
),
- [notify, run]
+ [notify, run, t]
);
return { convert, reidentify, remove };
diff --git a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
index 7ddccfde3e..58d88413ff 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/install-queue/InstallJobRow.tsx
@@ -34,7 +34,11 @@ export const InstallJobRow = ({
const { t } = useTranslation();
const { isBusy: isActing, run } = useScopedAction();
const connectionStatus = useConnectionStatusSelector((snapshot) => snapshot.status);
- const badge = STATUS_BADGES[job.status] ?? { label: job.status, palette: 'gray' };
+ // The Record is total for typed statuses; the fallback guards unknown
+ // statuses from an untyped backend payload.
+ const badge = STATUS_BADGES[job.status] as { labelKey: string; palette: string } | undefined;
+ const badgeLabel = badge ? t(badge.labelKey) : job.status;
+ const badgePalette = badge?.palette ?? 'gray';
const sourceLabel = getInstallSourceLabel(job.source);
const displayName = getInstallJobDisplayName(job);
// Parts the backend could not resume (or that errored) need a manual restart.
@@ -76,8 +80,8 @@ export const InstallJobRow = ({
<Icon as={TriangleAlertIcon} boxSize="3" color="fg.warning" flexShrink={0} />
</Tooltip>
) : null}
- <Badge colorPalette={badge.palette} flexShrink={0} fontSize="2xs" size="sm" variant="surface">
- {badge.label}
+ <Badge colorPalette={badgePalette} flexShrink={0} fontSize="2xs" size="sm" variant="surface">
+ {badgeLabel}
</Badge>
<HStack flexShrink={0} gap="0.5">
{job.status === 'downloading' ? (
diff --git a/invokeai/frontend/webv2/src/features/models/ui/install-queue/queueUtils.ts b/invokeai/frontend/webv2/src/features/models/ui/install-queue/queueUtils.ts
index 64528e1128..dcc291fdef 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/install-queue/queueUtils.ts
+++ b/invokeai/frontend/webv2/src/features/models/ui/install-queue/queueUtils.ts
@@ -2,15 +2,16 @@ import type { ModelInstallJob, ModelInstallStatus } from '@features/models/core/
import { getInstallSourceLabel } from '@features/models/core/taxonomy';
-export const STATUS_BADGES: Record<ModelInstallStatus, { label: string; palette: string }> = {
- cancelled: { label: 'Cancelled', palette: 'gray' },
- completed: { label: 'Installed', palette: 'green' },
- downloading: { label: 'Downloading', palette: 'blue' },
- downloads_done: { label: 'Downloaded', palette: 'blue' },
- error: { label: 'Failed', palette: 'red' },
- paused: { label: 'Paused', palette: 'orange' },
- running: { label: 'Installing', palette: 'blue' },
- waiting: { label: 'Waiting', palette: 'gray' },
+/** Labels are i18n keys — translate with `t(labelKey)` at the render site. */
+export const STATUS_BADGES: Record<ModelInstallStatus, { labelKey: string; palette: string }> = {
+ cancelled: { labelKey: 'models.statusCancelled', palette: 'gray' },
+ completed: { labelKey: 'models.installed', palette: 'green' },
+ downloading: { labelKey: 'models.statusDownloading', palette: 'blue' },
+ downloads_done: { labelKey: 'models.statusDownloaded', palette: 'blue' },
+ error: { labelKey: 'common.failed', palette: 'red' },
+ paused: { labelKey: 'models.statusPaused', palette: 'orange' },
+ running: { labelKey: 'models.installing', palette: 'blue' },
+ waiting: { labelKey: 'models.statusWaiting', palette: 'gray' },
};
export const getInstallJobDisplayName = (job: ModelInstallJob): string =>
diff --git a/invokeai/frontend/webv2/src/features/models/ui/shared/SourceListItem.tsx b/invokeai/frontend/webv2/src/features/models/ui/shared/SourceListItem.tsx
index d5f85e57b2..3eb369b8b2 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/shared/SourceListItem.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/shared/SourceListItem.tsx
@@ -6,6 +6,7 @@ import { useActiveInstallSources } from '@features/models/data/installsStore';
import { openInstallQueue } from '@features/models/ui/uiStore';
import { Button, Panel } from '@platform/ui';
import { DownloadIcon } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
/**
* The shared row used by every installable-source list (starter models,
@@ -63,13 +64,14 @@ export const InstallSourceButton = ({
/** Source string used to match an active install job. */
source: string;
}) => {
+ const { t } = useTranslation();
const activeSources = useActiveInstallSources();
const isInstalling = isPending || activeSources.has(source);
if (isInstalled) {
return (
<Badge colorPalette="green" flexShrink={0} fontSize="2xs" size="sm" variant="surface">
- Installed
+ {t('models.installed')}
</Badge>
);
}
@@ -79,7 +81,7 @@ export const InstallSourceButton = ({
<HStack flexShrink={0} gap="1.5">
<Badge colorPalette="blue" fontSize="2xs" size="sm" variant="surface">
<Spinner borderWidth="1.5px" boxSize="2.5" />
- Installing
+ {t('models.installing')}
</Badge>
<Button
size="2xs"
@@ -89,7 +91,7 @@ export const InstallSourceButton = ({
openInstallQueue();
}}
>
- View queue
+ {t('models.viewQueue')}
</Button>
</HStack>
);
@@ -106,7 +108,7 @@ export const InstallSourceButton = ({
}}
>
<Icon as={DownloadIcon} boxSize="3" />
- Install
+ {t('models.install')}
</Button>
);
};
diff --git a/invokeai/frontend/webv2/src/features/models/ui/useInstallOutcomeToasts.ts b/invokeai/frontend/webv2/src/features/models/ui/useInstallOutcomeToasts.ts
index e2d9553886..79f45ea860 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/useInstallOutcomeToasts.ts
+++ b/invokeai/frontend/webv2/src/features/models/ui/useInstallOutcomeToasts.ts
@@ -1,6 +1,7 @@
import { useInstallOutcomes } from '@features/models/data/installsStore';
import { useNotify } from '@features/models/ui/useModelsNotify';
import { useEffect, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
/**
* Turns settled install outcomes (completed/failed/cancelled) into notifications,
@@ -8,6 +9,7 @@ import { useEffect, useRef } from 'react';
* global toasts off-workbench. Mounted by `ModelInstallRuntime`.
*/
export const useInstallOutcomeToasts = (): void => {
+ const { t } = useTranslation();
const notify = useNotify();
const outcomes = useInstallOutcomes();
const seenOutcomeIdsRef = useRef<Set<number> | null>(null);
@@ -27,12 +29,12 @@ export const useInstallOutcomeToasts = (): void => {
seenOutcomeIdsRef.current.add(outcome.id);
if (outcome.kind === 'completed') {
- notify.success('Model installed', outcome.modelName ?? outcome.source);
+ notify.success(t('models.modelInstalled'), outcome.modelName ?? outcome.source);
} else if (outcome.kind === 'error') {
- notify.error('Model install failed', `${outcome.source}: ${outcome.error ?? 'Unknown error.'}`);
+ notify.error(t('models.modelInstallFailed'), `${outcome.source}: ${outcome.error ?? t('common.unknownError')}`);
} else {
- notify.info('Model install cancelled', outcome.source);
+ notify.info(t('models.modelInstallCancelled'), outcome.source);
}
}
- }, [notify, outcomes]);
+ }, [notify, outcomes, t]);
};