Skip to content

Commit d45931a

Browse files
rohinish404psychedelicious
authored andcommitted
fix(ui): localize text
1 parent c1de129 commit d45931a

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed

invokeai/frontend/web/public/locales/en.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,9 +1435,17 @@
14351435
"undo": "Undo"
14361436
},
14371437
"workflows": {
1438+
"ascending": "Ascending",
1439+
"created": "Created",
1440+
"desceding": "Descending",
14381441
"workflows": "Workflows",
14391442
"workflowLibrary": "Library",
1443+
"userWorkflows": "My Workflows",
1444+
"defaultWorkflows": "Default Workflows",
1445+
"projectWorkflows": "Project Workflows",
1446+
"opened": "Opened",
14401447
"openWorkflow": "Open Workflow",
1448+
"updated": "Updated",
14411449
"uploadWorkflow": "Load from File",
14421450
"deleteWorkflow": "Delete Workflow",
14431451
"unnamedWorkflow": "Unnamed Workflow",
@@ -1448,6 +1456,9 @@
14481456
"savingWorkflow": "Saving Workflow...",
14491457
"problemSavingWorkflow": "Problem Saving Workflow",
14501458
"workflowSaved": "Workflow Saved",
1459+
"name": "Name",
1460+
"noRecentWorkflows": "No Recent Workflows",
1461+
"noUserWorkflows": "No User Workflows",
14511462
"noWorkflows": "No Workflows",
14521463
"problemLoading": "Problem Loading Workflows",
14531464
"loading": "Loading Workflows",

invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorDataTab.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { useAppSelector } from 'app/store/storeHooks';
33
import { IAINoContentFallback } from 'common/components/IAIImageFallback';
44
import DataViewer from 'features/gallery/components/ImageMetadataViewer/DataViewer';
55
import { selectNodesSlice } from 'features/nodes/store/nodesSlice';
6+
import { useTranslation } from 'react-i18next';
67
import { memo } from 'react';
7-
88
const selector = createMemoizedSelector(selectNodesSlice, (nodes) => {
99
const lastSelectedNodeId = nodes.selectedNodes[nodes.selectedNodes.length - 1];
1010

@@ -16,10 +16,11 @@ const selector = createMemoizedSelector(selectNodesSlice, (nodes) => {
1616
});
1717

1818
const InspectorDataTab = () => {
19+
const { t } = useTranslation();
1920
const { data } = useAppSelector(selector);
2021

2122
if (!data) {
22-
return <IAINoContentFallback label="No node selected" icon={null} />;
23+
return <IAINoContentFallback label={t('nodes.noNodeSelected')} icon={null} />;
2324
}
2425

2526
return <DataViewer data={data} label="Node Data" />;

invokeai/frontend/web/src/features/parameters/components/Canvas/InfillAndScaling/ParamScaleBeforeProcessing.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ import { selectOptimalDimension } from 'features/parameters/store/generationSlic
88
import { memo, useCallback, useMemo } from 'react';
99
import { useTranslation } from 'react-i18next';
1010

11-
const OPTIONS: ComboboxOption[] = [
12-
{ label: 'None', value: 'none' },
13-
{ label: 'Auto', value: 'auto' },
14-
{ label: 'Manual', value: 'manual' },
15-
];
1611

1712
const ParamScaleBeforeProcessing = () => {
1813
const dispatch = useAppDispatch();
1914
const { t } = useTranslation();
2015
const boundingBoxScaleMethod = useAppSelector((s) => s.canvas.boundingBoxScaleMethod);
2116
const optimalDimension = useAppSelector(selectOptimalDimension);
2217

18+
const OPTIONS: ComboboxOption[] = useMemo(() => [
19+
{ label: t('modelManager.none'), value: 'none' },
20+
{ label: t('common.auto'), value: 'auto' },
21+
{ label: t('modelManager.manual'), value: 'manual' },
22+
],
23+
[t]
24+
);
25+
2326
const onChange = useCallback<ComboboxOnChange>(
2427
(v) => {
2528
if (!isBoundingBoxScaleMethod(v?.value)) {

invokeai/frontend/web/src/features/workflowLibrary/components/WorkflowLibraryList.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,11 @@ const PER_PAGE = 10;
3737
const zOrderBy = z.enum(['opened_at', 'created_at', 'updated_at', 'name']);
3838
type OrderBy = z.infer<typeof zOrderBy>;
3939
const isOrderBy = (v: unknown): v is OrderBy => zOrderBy.safeParse(v).success;
40-
const ORDER_BY_OPTIONS: ComboboxOption[] = [
41-
{ value: 'opened_at', label: 'Opened' },
42-
{ value: 'created_at', label: 'Created' },
43-
{ value: 'updated_at', label: 'Updated' },
44-
{ value: 'name', label: 'Name' },
45-
];
4640

4741
const zDirection = z.enum(['ASC', 'DESC']);
4842
type Direction = z.infer<typeof zDirection>;
4943
const isDirection = (v: unknown): v is Direction => zDirection.safeParse(v).success;
50-
const DIRECTION_OPTIONS: ComboboxOption[] = [
51-
{ value: 'ASC', label: 'Ascending' },
52-
{ value: 'DESC', label: 'Descending' },
53-
];
44+
5445

5546
const WorkflowLibraryList = () => {
5647
const { t } = useTranslation();
@@ -60,6 +51,22 @@ const WorkflowLibraryList = () => {
6051
const [query, setQuery] = useState('');
6152
const projectId = useStore($projectId);
6253

54+
const ORDER_BY_OPTIONS: ComboboxOption[] = useMemo(() => [
55+
{ value: 'opened_at', label: t('workflows.opened') },
56+
{ value: 'created_at', label: t('workflows.created') },
57+
{ value: 'updated_at', label: t('workflows.updated') },
58+
{ value: 'name', label: t('workflows.name') },
59+
],
60+
[t]
61+
);
62+
63+
const DIRECTION_OPTIONS: ComboboxOption[] = useMemo(() => [
64+
{ value: 'ASC', label: t('workflows.ascending') },
65+
{ value: 'DESC', label: t('workflows.descending') },
66+
],
67+
[t]
68+
);
69+
6370
const orderByOptions = useMemo(() => {
6471
return projectId ? ORDER_BY_OPTIONS.filter((option) => option.value !== 'opened_at') : ORDER_BY_OPTIONS;
6572
}, [projectId]);

0 commit comments

Comments
 (0)