Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue where some of the text translations were not working #2291

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gui/src/components/nfts/NFTPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export default function NFTPreview(props: NFTPreviewProps) {
<StyledCardPreview width={width} height={height} sx={{ aspectRatio: ratio.toString() }}>
{isLoading ? (
<Flex position="absolute" left="0" top="0" bottom="0" right="0" justifyContent="center" alignItems="center">
<Loading center>{!isCompact && <Trans>{isPreview ? 'Loading preview...' : 'Loading NFT...'}</Trans>}</Loading>
<Loading center>{!isCompact && (isPreview ? t`Loading preview...` : t`Loading NFT...`)}</Loading>
</Flex>
) : !hasFile ? (
<Background>
Expand Down
21 changes: 13 additions & 8 deletions packages/gui/src/components/plot/add/PlotAddChoosePlotter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,19 @@ export default function PlotAddChoosePlotter(props: Props) {
}

const plotterWarningString = (name: PlotterName | undefined): string | undefined => {
if (name === PlotterName.BLADEBIT_RAM) {
return plotters[PlotterName.BLADEBIT_RAM]?.installInfo?.bladebitMemoryWarning;
if (name !== PlotterName.BLADEBIT_RAM) {
return undefined;
}
return undefined;
const msg = plotters[PlotterName.BLADEBIT_RAM]?.installInfo?.bladebitMemoryWarning;
if (!msg) {
return undefined;
}
const regex = /BladeBit requires at least (?<ram>\d*[.]?\d+) GiB of RAM to operate/;
const m = regex.exec(msg);
if (!m || !m.groups || !m.groups.ram) {
return t`Insufficient RAM for BladeBit`;
}
return t`BladeBit requires at least ${m.groups.ram} GiB of RAM to operate`;
};

const warning = plotterWarningString(plotterName);
Expand Down Expand Up @@ -101,11 +110,7 @@ export default function PlotAddChoosePlotter(props: Props) {
</MenuItem>
))}
</Select>
{warning && (
<StyledFormHelperText>
<Trans>{warning}</Trans>
</StyledFormHelperText>
)}
{warning && <StyledFormHelperText>{warning}</StyledFormHelperText>}
</FormControl>
</Grid>
</Grid>
Expand Down
24 changes: 12 additions & 12 deletions packages/gui/src/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useLocalStorage } from '@chia-network/api-react';
import { Flex, LayoutDashboardSub, Mode, useMode } from '@chia-network/core';
import { Trans } from '@lingui/macro';
import { Trans, t } from '@lingui/macro';
import { Typography, Tab, Tabs } from '@mui/material';
import Badge from '@mui/material/Badge';
import React, { useMemo } from 'react';
Expand All @@ -26,24 +26,24 @@ export default function Settings() {

const settingsTabs = useMemo(() => {
let tabs = [
{ id: 'general', label: 'General', Component: SettingsGeneral, path: 'general' },
{ id: 'general', label: t`General`, Component: SettingsGeneral, path: 'general' },
{
id: 'custody',
label: 'Custody',
label: t`Custody`,
Component: SettingsCustody,
path: 'custody',
badge: wasSettingsCustodyVisited ? undefined : 'NEW',
},
{ id: 'profiles', label: 'Profiles (DIDs)', Component: SettingsProfiles, path: 'profiles/*' },
{ id: 'nft', label: 'NFT', Component: SettingsNFT, path: 'nft' },
{ id: 'datalayer', label: 'DataLayer', Component: SettingsDataLayer, path: 'datalayer' },
{ id: 'harvester', label: 'Harvester', Component: SettingsHarvester, path: 'harvester' },
{ id: 'integration', label: 'Integration', Component: SettingsIntegration, path: 'integration' },
{ id: 'notifications', label: 'Notifications', Component: SettingsNotifications, path: 'notifications' },
{ id: 'advanced', label: 'Advanced', Component: SettingsAdvanced, path: 'advanced' },
{ id: 'profiles', label: t`Profiles (DIDs)`, Component: SettingsProfiles, path: 'profiles/*' },
{ id: 'nft', label: t`NFT`, Component: SettingsNFT, path: 'nft' },
{ id: 'datalayer', label: t`DataLayer`, Component: SettingsDataLayer, path: 'datalayer' },
{ id: 'harvester', label: t`Harvester`, Component: SettingsHarvester, path: 'harvester' },
{ id: 'integration', label: t`Integration`, Component: SettingsIntegration, path: 'integration' },
{ id: 'notifications', label: t`Notifications`, Component: SettingsNotifications, path: 'notifications' },
{ id: 'advanced', label: t`Advanced`, Component: SettingsAdvanced, path: 'advanced' },
];
if (mode === Mode.WALLET) {
tabs = tabs.filter((t) => t.id !== 'harvester');
tabs = tabs.filter((tab) => tab.id !== 'harvester');
}
return tabs;
}, [wasSettingsCustodyVisited, mode]);
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function Settings() {
sx={{ '& .MuiTabs-flexContainer': { paddingTop: '10px' } }}
>
{settingsTabs.map((tab) => {
let TabLabel = <Trans>{tab.label}</Trans>;
let TabLabel: React.ReactNode = tab.label;
if (tab.badge) {
TabLabel = (
<Badge
Expand Down
Loading