Skip to content

Commit 83344f5

Browse files
V-Girae-maad
andauthored
runfix: address cells localization strings (#19216)
Co-authored-by: Immad Abdul Jabbar <[email protected]>
1 parent fe95c1d commit 83344f5

File tree

26 files changed

+87
-103
lines changed

26 files changed

+87
-103
lines changed

src/script/components/CellsGlobalView/CellsGlobalView.tsx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const CellsGlobalView = ({cellsRepository = container.resolve(CellsReposi
4747
});
4848

4949
const deleteFileFailedNotification = useAppNotification({
50-
message: t('cellsGlobalView.deleteModalError'),
50+
message: t('cells.deleteModal.error'),
5151
});
5252

5353
const handleDeleteFile = useCallback(
@@ -99,28 +99,20 @@ export const CellsGlobalView = ({cellsRepository = container.resolve(CellsReposi
9999
/>
100100
{emptySearchResults && (
101101
<CellsStateInfo
102-
heading={t('cellsGlobalView.emptySearchResultsHeading')}
103-
description={t('cellsGlobalView.emptySearchResultsDescription')}
102+
heading={t('cells.emptySearchResults.heading')}
103+
description={t('cells.emptySearchResults.description')}
104104
/>
105105
)}
106106
{showTable && <CellsTable files={files} cellsRepository={cellsRepository} onDeleteFile={handleDeleteFile} />}
107107
{showNoFiles && (
108-
<CellsStateInfo
109-
heading={t('cellsGlobalView.noFilesHeading')}
110-
description={t('cellsGlobalView.noFilesDescription')}
111-
/>
108+
<CellsStateInfo heading={t('cells.noNodes.heading')} description={t('cells.noNodes.description')} />
112109
)}
113110
{showLoader && <CellsLoader />}
114-
{isError && (
115-
<CellsStateInfo
116-
heading={t('cellsGlobalView.errorHeading')}
117-
description={t('cellsGlobalView.errorDescription')}
118-
/>
119-
)}
111+
{isError && <CellsStateInfo heading={t('cells.error.heading')} description={t('cells.error.description')} />}
120112
{showLoadMore && (
121113
<div css={loadMoreWrapperStyles}>
122114
<Button variant={ButtonVariant.TERTIARY} onClick={increasePageSize}>
123-
{t('cellsGlobalView.pagination.loadMoreResults')}
115+
{t('cells.pagination.loadMoreResults')}
124116
</Button>
125117
</div>
126118
)}

src/script/components/CellsGlobalView/CellsHeader/CellsHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ interface CellsHeaderProps {
3636
export const CellsHeader = ({searchValue, onSearch, onClearSearch, onRefresh, searchStatus}: CellsHeaderProps) => {
3737
return (
3838
<header css={wrapperStyles}>
39-
<h2 css={headingStyles}>{t('cellsGlobalView.heading')}</h2>
39+
<h2 css={headingStyles}>{t('cells.heading')}</h2>
4040
<div css={contentStyles}>
4141
<div css={searchWrapperStyles}>
4242
<CellsSearch searchValue={searchValue} onSearch={onSearch} onClearSearch={onClearSearch} />
4343
{searchStatus === 'loading' && <CellsTableLoader />}
44-
{searchStatus === 'error' && <p>{t('cellsGlobalView.searchFailed')}</p>}
44+
{searchStatus === 'error' && <p>{t('cells.search.failed')}</p>}
4545
</div>
4646
<CellsRefresh onRefresh={onRefresh} />
4747
</div>

src/script/components/CellsGlobalView/CellsHeader/CellsRefresh/CellsRefresh.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CellsRefresh = ({onRefresh}: CellsRefreshProps) => {
3131
return (
3232
<Button variant={ButtonVariant.TERTIARY} onClick={onRefresh} css={buttonStyles}>
3333
<ReloadIcon css={iconStyles} />
34-
{t('cellsGlobalView.refreshButton')}
34+
{t('cells.refreshButton')}
3535
</Button>
3636
);
3737
};

src/script/components/CellsGlobalView/CellsHeader/CellsSearch/CellsSeach.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export const CellsSearch = ({searchValue, onSearch, onClearSearch}: CellsSearchP
5555
<form css={wrapperStyles} onSubmit={handleSubmit}>
5656
<Input
5757
value={searchValue}
58-
placeholder={t('cellsGlobalView.searchPlaceholder')}
59-
aria-label={t('cellsGlobalView.searchPlaceholder')}
58+
placeholder={t('cells.search.placeholder')}
59+
aria-label={t('cells.search.placeholder')}
6060
name="cells-global-view-search"
6161
onChange={event => onSearch(event.currentTarget.value)}
6262
startContent={<SearchIcon width={14} height={14} css={searchIconStyles} />}
@@ -67,7 +67,7 @@ export const CellsSearch = ({searchValue, onSearch, onClearSearch}: CellsSearchP
6767
type="button"
6868
onClick={onClearSearch}
6969
css={closeButtonStyles}
70-
aria-label={t('cellsGlobalView.searchCloseButton')}
70+
aria-label={t('cells.search.closeButton')}
7171
>
7272
<CircleCloseIcon className="cursor-pointer" css={closeIconStyles} />
7373
</button>

src/script/components/CellsGlobalView/CellsTable/CellsTableColumns/CellsShareFileModal/CellsShareFileModal.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ interface ShareFileModalParams {
4545

4646
export const showShareFileModal = ({uuid, cellsRepository}: ShareFileModalParams) => {
4747
PrimaryModal.show(PrimaryModal.type.CONFIRM, {
48-
primaryAction: {action: () => {}, text: t('cellsGlobalView.shareFileModalPrimaryAction')},
48+
primaryAction: {action: () => {}, text: t('cells.shareModal.primaryAction')},
4949
text: {
5050
message: <CellsShareFileModalContent uuid={uuid} cellsRepository={cellsRepository} />,
51-
title: t('cellsGlobalView.shareFileModalHeading'),
51+
title: t('cells.shareModal.heading'),
5252
},
5353
});
5454
};
@@ -63,10 +63,10 @@ const CellsShareFileModalContent = ({uuid, cellsRepository}: ShareFileModalParam
6363
<div css={switchContainerStyles}>
6464
<div>
6565
<Label htmlFor="switch-public-link" css={labelStyles}>
66-
{t('cellsGlobalView.shareFileModalEnablePublicLink')}
66+
{t('cells.shareModal.enablePublicLink')}
6767
</Label>
6868
<p id="switch-public-link-description" css={publicLinkDescriptionStyles}>
69-
{t('cellsGlobalView.shareFileModalEnablePublicLinkDescription')}
69+
{t('cells.shareModal.enablePublicLink.file.description')}
7070
</p>
7171
</div>
7272
<div css={switchWrapperStyles}>
@@ -82,13 +82,13 @@ const CellsShareFileModalContent = ({uuid, cellsRepository}: ShareFileModalParam
8282
{isEnabled && status === 'success' && link && (
8383
<div css={inputWrapperStyles}>
8484
<label htmlFor="generated-public-link" className="visually-hidden">
85-
{t('cellsGlobalView.shareFileModalGeneratedPublicLink')}
85+
{t('cells.shareModal.generatedPublicLink')}
8686
</label>
8787
<Input id="generated-public-link" value={link} wrapperCSS={inputStyles} disabled={isInputDisabled} readOnly />
8888
<CopyToClipboardButton
8989
textToCopy={link}
90-
displayText={t('cellsGlobalView.shareFileModalCopyLink')}
91-
copySuccessText={t('cellsGlobalView.shareFileModalLinkCopied')}
90+
displayText={t('cells.shareModal.copyLink')}
91+
copySuccessText={t('cells.shareModal.linkCopied')}
9292
/>
9393
</div>
9494
)}
@@ -97,7 +97,7 @@ const CellsShareFileModalContent = ({uuid, cellsRepository}: ShareFileModalParam
9797
<CellsTableLoader />
9898
</div>
9999
)}
100-
{status === 'error' && <div>{t('cellsGlobalView.shareFileModalErrorLoadingLink')}</div>}
100+
{status === 'error' && <div>{t('cells.shareModal.error.loadingLink')}</div>}
101101
</div>
102102
);
103103
};

src/script/components/CellsGlobalView/CellsTable/CellsTableColumns/CellsTableColumns.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,36 @@ export const getCellsTableColumns = ({
4040
cellsRepository: CellsRepository;
4141
}) => [
4242
columnHelper.accessor('name', {
43-
header: t('cellsGlobalView.tableRowName'),
43+
header: t('cells.tableRow.name'),
4444
cell: info => <CellsTableNameColumn file={info.row.original} />,
4545
}),
4646
columnHelper.accessor('conversationName', {
47-
header: t('cellsGlobalView.tableRowConversationName'),
47+
header: t('cells.tableRow.conversationName'),
4848
cell: info => <span css={textWithEllipsisStyles}>{info.getValue()}</span>,
4949
size: 190,
5050
}),
5151
columnHelper.accessor('owner', {
52-
header: t('cellsGlobalView.tableRowOwner'),
52+
header: t('cells.tableRow.owner'),
5353
cell: info => <span css={textWithEllipsisStyles}>{info.getValue()}</span>,
5454
size: 175,
5555
}),
5656
columnHelper.accessor('sizeMb', {
57-
header: t('cellsGlobalView.tableRowSize'),
57+
header: t('cells.tableRow.size'),
5858
cell: info => info.getValue(),
5959
size: 100,
6060
}),
6161
columnHelper.accessor('uploadedAtTimestamp', {
62-
header: t('cellsGlobalView.tableRowCreated'),
62+
header: t('cells.tableRow.created'),
6363
cell: info => <CellsTableDateColumn timestamp={info.getValue()} />,
6464
size: 125,
6565
}),
6666
columnHelper.accessor('publicLink', {
67-
header: t('cellsGlobalView.tableRowPublicLink'),
67+
header: t('cells.tableRow.publicLink'),
6868
cell: info => <CellsTableSharedColumn isShared={!!info.getValue()?.alreadyShared} />,
6969
size: 60,
7070
}),
7171
columnHelper.accessor('id', {
72-
header: () => <span className="visually-hidden">{t('cellsGlobalView.tableRowActions')}</span>,
72+
header: () => <span className="visually-hidden">{t('cells.tableRow.actions')}</span>,
7373
size: 40,
7474
cell: info => (
7575
<CellsTableRowOptions file={info.row.original} onDelete={onDeleteFile} cellsRepository={cellsRepository} />

src/script/components/CellsGlobalView/CellsTable/CellsTableColumns/CellsTableRowOptions/CellsTableRowOptions.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ export const CellsTableRowOptions = ({file, onDelete, cellsRepository}: CellsTab
4646
const showDeleteFileModal = useCallback(
4747
({uuid, name}: {uuid: string; name: string}) => {
4848
PrimaryModal.show(PrimaryModal.type.CONFIRM, {
49-
primaryAction: {action: () => onDelete(uuid), text: t('cellsGlobalView.optionDelete')},
49+
primaryAction: {action: () => onDelete(uuid), text: t('cells.options.delete')},
5050
text: {
51-
message: t('cellsGlobalView.deleteModalDescription', {name}),
52-
title: t('cellsGlobalView.deleteModalHeading'),
51+
message: t('cells.deleteModal.description', {name}),
52+
title: t('cells.deleteModal.heading'),
5353
},
5454
});
5555
},
5656
[onDelete],
5757
);
5858

5959
const showOptionsMenu = (event: ReactMouseEvent<HTMLButtonElement> | MouseEvent) => {
60-
const openLabel = t('cellsGlobalView.optionOpen');
61-
const shareLabel = t('cellsGlobalView.optionShare');
62-
const downloadLabel = t('cellsGlobalView.optionDownload');
63-
const deleteLabel = t('cellsGlobalView.optionDelete');
60+
const openLabel = t('cells.options.open');
61+
const shareLabel = t('cells.options.share');
62+
const downloadLabel = t('cells.options.download');
63+
const deleteLabel = t('cells.options.delete');
6464

6565
const fileUrl = file.fileUrl;
6666

@@ -91,13 +91,13 @@ export const CellsTableRowOptions = ({file, onDelete, cellsRepository}: CellsTab
9191
css={buttonStyles}
9292
onKeyDown={handleKeyDown}
9393
onClick={showOptionsMenu}
94-
aria-label={t('cellsGlobalView.optionsLabel')}
94+
aria-label={t('cells.options.label')}
9595
aria-controls={id}
9696
aria-expanded={!!selectedFile}
9797
aria-haspopup="dialog"
9898
>
9999
<MoreIcon css={iconStyles} />
100-
<span css={textStyles}>{t('cellsGlobalView.optionsLabel')}</span>
100+
<span css={textStyles}>{t('cells.options.label')}</span>
101101
</button>
102102
);
103103
};

src/script/components/CellsGlobalView/CellsTable/CellsTableColumns/CellsTableSharedColumn/CellsTableSharedColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const CellsTableSharedColumn = ({isShared}: CellsTableSharedColumnProps)
3333
<LinkIcon width={10} height={10} />
3434
</div>
3535
<span css={textStyles}>
36-
{isShared ? t('cellsGlobalView.tableRowSharedTruthyValue') : t('cellsGlobalView.tableRowSharedFalsyValue')}
36+
{isShared ? t('cells.tableRow.shared.truthyValue') : t('cells.tableRow.shared.falsyValue')}
3737
</span>
3838
</div>
3939
);

src/script/components/Conversation/ConversationCells/CellsHeader/CellsRefresh/CellsRefresh.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CellsRefresh = ({onRefresh}: CellsRefreshProps) => {
3131
return (
3232
<Button variant={ButtonVariant.TERTIARY} onClick={onRefresh} css={buttonStyles}>
3333
<ReloadIcon css={iconStyles} />
34-
{t('cellsGlobalView.refreshButton')}
34+
{t('cells.refreshButton')}
3535
</Button>
3636
);
3737
};

src/script/components/Conversation/ConversationCells/CellsHeader/CellsSearch/CellsSearch.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export const CellsSearch = ({searchValue, onSearch, onClearSearch}: CellsSearchP
5555
<form css={wrapperStyles} onSubmit={handleSubmit}>
5656
<Input
5757
value={searchValue}
58-
placeholder={t('cellsGlobalView.searchPlaceholder')}
59-
aria-label={t('cellsGlobalView.searchPlaceholder')}
58+
placeholder={t('cells.search.placeholder')}
59+
aria-label={t('cells.search.placeholder')}
6060
name="cells-global-view-search"
6161
onChange={event => onSearch(event.currentTarget.value)}
6262
startContent={<SearchIcon width={14} height={14} css={searchIconStyles} />}
@@ -67,7 +67,7 @@ export const CellsSearch = ({searchValue, onSearch, onClearSearch}: CellsSearchP
6767
type="button"
6868
onClick={onClearSearch}
6969
css={closeButtonStyles}
70-
aria-label={t('cellsGlobalView.searchCloseButton')}
70+
aria-label={t('cells.search.closeButton')}
7171
>
7272
<CircleCloseIcon className="cursor-pointer" css={closeIconStyles} />
7373
</button>

0 commit comments

Comments
 (0)