Skip to content

Commit d6e49d0

Browse files
committed
feat: add missing translation keys
1 parent 215ff3a commit d6e49d0

File tree

3 files changed

+80
-71
lines changed

3 files changed

+80
-71
lines changed

packages/core/src/ui/components/AssetSelector/AssetSelectorOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const AssetSelectorOverlay = ({
168168
setValue('');
169169
}}
170170
withSearchIcon
171-
inputPlaceholder={t('asset.searchPlaceholder')}
171+
inputPlaceholder={t('core.asset.searchPlaceholder')}
172172
onChange={handleSearch}
173173
value={value}
174174
onFocus={() => setFocus(true)}

packages/core/src/ui/components/Nft/NftDetail.tsx

Lines changed: 76 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FolderOutlined, RightOutlined } from '@ant-design/icons';
88
import { Box, ControlButton, Flex } from '@input-output-hk/lace-ui-toolkit';
99
import { ReactComponent as ProfileIcon } from '../../assets/icons/profile-icon.component.svg';
1010
import { ReactComponent as PrintNftIcon } from '../../assets/icons/print-nft.component.svg';
11+
import { useTranslation } from 'react-i18next';
1112

1213
export interface NftDetailProps {
1314
title?: ReactNode;
@@ -43,80 +44,86 @@ export const NftDetail = ({
4344
onSetAsAvatar,
4445
onPrintNft,
4546
isPopup
46-
}: NftDetailProps): React.ReactElement => (
47-
<div className={styles.nftDetail}>
48-
{title}
49-
<div className={styles.imageContainer}>
50-
<div className={styles.imageWrapper}>
51-
{Number(amount) > 1 && (
52-
<div data-testid="nft-item-amount" className={styles.amount}>
53-
{amount}
54-
</div>
55-
)}
56-
<NftImage image={image} detailView popupView />
47+
}: NftDetailProps): React.ReactElement => {
48+
const { t } = useTranslation();
49+
const rootKey = t('core.nftFolderName.root');
50+
return (
51+
<div className={styles.nftDetail}>
52+
{title}
53+
<div className={styles.imageContainer}>
54+
<div className={styles.imageWrapper}>
55+
{Number(amount) > 1 && (
56+
<div data-testid="nft-item-amount" className={styles.amount}>
57+
{amount}
58+
</div>
59+
)}
60+
<NftImage image={image} detailView popupView />
61+
</div>
5762
</div>
58-
</div>
59-
<Flex w="$fill" gap="$24" flexDirection={isPopup ? 'column' : 'row'} justifyContent="center" px="$10">
60-
<ControlButton.Outlined
61-
w={onPrintNft ? '$fill' : undefined}
62-
size="small"
63-
label={translations.setAsAvatar}
64-
icon={<ProfileIcon />}
65-
onClick={() => image && onSetAsAvatar?.(image)}
66-
data-testid="nft-set-as-avatar-button"
67-
/>
68-
{onPrintNft && (
63+
<Flex w="$fill" gap="$24" flexDirection={isPopup ? 'column' : 'row'} justifyContent="center" px="$10">
6964
<ControlButton.Outlined
70-
w="$fill"
65+
w={onPrintNft ? '$fill' : undefined}
7166
size="small"
72-
label={translations.printNft}
73-
icon={<PrintNftIcon />}
74-
onClick={() => onPrintNft()}
75-
data-testid="nft-print-button"
67+
label={translations.setAsAvatar}
68+
icon={<ProfileIcon />}
69+
onClick={() => image && onSetAsAvatar?.(image)}
70+
data-testid="nft-set-as-avatar-button"
7671
/>
77-
)}
78-
</Flex>
79-
<div className={styles.info}>
80-
<div data-testid="nft-info" className={styles.section}>
81-
<h4 data-testid="nft-info-label">{translations.tokenInformation}</h4>
82-
<InlineInfoList
83-
items={[
84-
...tokenInformation,
85-
{
86-
name: translations.directory,
87-
value: folder ? `Root > ${folder}` : 'Root',
88-
renderValueAs: !isPopup ? (
89-
<Breadcrumb separator={<RightOutlined />}>
90-
<Breadcrumb.Item>
91-
<FolderOutlined />
92-
<span data-testid="folder-path-1">Root</span>
93-
</Breadcrumb.Item>
94-
{folder && (
72+
{onPrintNft && (
73+
<ControlButton.Outlined
74+
w="$fill"
75+
size="small"
76+
label={translations.printNft}
77+
icon={<PrintNftIcon />}
78+
onClick={() => onPrintNft()}
79+
data-testid="nft-print-button"
80+
/>
81+
)}
82+
</Flex>
83+
<div className={styles.info}>
84+
<div data-testid="nft-info" className={styles.section}>
85+
<h4 data-testid="nft-info-label">{translations.tokenInformation}</h4>
86+
<InlineInfoList
87+
items={[
88+
...tokenInformation,
89+
{
90+
name: translations.directory,
91+
value: folder ? `${rootKey} > ${folder}` : rootKey,
92+
renderValueAs: !isPopup ? (
93+
<Breadcrumb separator={<RightOutlined />}>
9594
<Breadcrumb.Item>
96-
<Ellipsis text={folder} beforeEllipsis={5} afterEllipsis={5} dataTestId="folder-path-2" />
95+
<FolderOutlined />
96+
<span data-testid="folder-path-1">Root</span>
9797
</Breadcrumb.Item>
98-
)}
99-
</Breadcrumb>
100-
) : (
101-
<Flex justifyContent="space-between" gap="$1">
102-
<Box testId="folder-path-1">Root</Box>
103-
{folder && <Box px="$8">{'>'}</Box>}
104-
{folder && <Ellipsis text={folder} beforeEllipsis={5} afterEllipsis={5} dataTestId="folder-path-2" />}
105-
</Flex>
106-
)
107-
}
108-
]}
109-
/>
98+
{folder && (
99+
<Breadcrumb.Item>
100+
<Ellipsis text={folder} beforeEllipsis={5} afterEllipsis={5} dataTestId="folder-path-2" />
101+
</Breadcrumb.Item>
102+
)}
103+
</Breadcrumb>
104+
) : (
105+
<Flex justifyContent="space-between" gap="$1">
106+
<Box testId="folder-path-1">{rootKey}</Box>
107+
{folder && <Box px="$8">{'>'}</Box>}
108+
{folder && (
109+
<Ellipsis text={folder} beforeEllipsis={5} afterEllipsis={5} dataTestId="folder-path-2" />
110+
)}
111+
</Flex>
112+
)
113+
}
114+
]}
115+
/>
116+
</div>
117+
{attributes && (
118+
<>
119+
<div className={styles.separator} />
120+
<div data-testid="nft-attributes" className={styles.section}>
121+
<h4 data-testid="nft-attributes-label">{translations.attributes}</h4>
122+
<InlineInfoList items={parseAttributes(JSON.parse(attributes))} />
123+
</div>
124+
</>
125+
)}
110126
</div>
111-
{attributes && (
112-
<>
113-
<div className={styles.separator} />
114-
<div data-testid="nft-attributes" className={styles.section}>
115-
<h4 data-testid="nft-attributes-label">{translations.attributes}</h4>
116-
<InlineInfoList items={parseAttributes(JSON.parse(attributes))} />
117-
</div>
118-
</>
119-
)}
120127
</div>
121-
</div>
122-
);
128+
);
129+
};

packages/translation/src/lib/translations/core/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,5 +713,7 @@
713713
"core.derivationType.ledger": "Ledger",
714714
"core.derivationType.ledgerDescription": "Select if connecting a Ledger-created wallet",
715715
"core.derivationType.selectDerivationType": "Derivation type",
716-
"core.derivationType.infoTooltip": "Determines how accounts and addresses are generated from your seed phrase."
716+
"core.derivationType.infoTooltip": "Determines how accounts and addresses are generated from your seed phrase.",
717+
"core.nftFolderName.root": "Root",
718+
"asset.searchPlaceholder": "Search by ID or name"
717719
}

0 commit comments

Comments
 (0)