Skip to content

Commit c77c12a

Browse files
fix(ui): missing builder translations
1 parent 731992c commit c77c12a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,8 @@
17411741
"row": "Row",
17421742
"column": "Column",
17431743
"container": "Container",
1744+
"containerRowLayout": "Container (row layout)",
1745+
"containerColumnLayout": "Container (column layout)",
17441746
"heading": "Heading",
17451747
"text": "Text",
17461748
"divider": "Divider",

invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/FormElementEditModeHeader.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useZoomToNode } from 'features/nodes/hooks/useZoomToNode';
99
import { formElementRemoved } from 'features/nodes/store/workflowSlice';
1010
import type { FormElement, NodeFieldElement } from 'features/nodes/types/workflow';
1111
import { isContainerElement, isNodeFieldElement } from 'features/nodes/types/workflow';
12-
import { startCase } from 'lodash-es';
12+
import { camelCase } from 'lodash-es';
1313
import type { RefObject } from 'react';
1414
import { memo, useCallback, useMemo } from 'react';
1515
import { useTranslation } from 'react-i18next';
@@ -103,15 +103,16 @@ const RemoveElementButton = memo(({ element }: { element: FormElement }) => {
103103
RemoveElementButton.displayName = 'RemoveElementButton';
104104

105105
const Label = memo(({ element }: { element: FormElement }) => {
106+
const { t } = useTranslation();
106107
const label = useMemo(() => {
107108
if (isContainerElement(element) && element.data.layout === 'column') {
108-
return `Container (column layout)`;
109+
return t('workflows.builder.containerColumnLayout');
109110
}
110111
if (isContainerElement(element) && element.data.layout === 'row') {
111-
return `Container (row layout)`;
112+
return t('workflows.builder.containerRowLayout');
112113
}
113-
return startCase(element.type);
114-
}, [element]);
114+
return t(`workflows.builder.${camelCase(element.type)}`);
115+
}, [element, t]);
115116

116117
return (
117118
<Text fontWeight="semibold" noOfLines={1} wordBreak="break-all" userSelect="none">

0 commit comments

Comments
 (0)