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

fix: add missing translation and slider label #6

Merged
merged 1 commit into from
Apr 1, 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
4 changes: 2 additions & 2 deletions frontend/src/components/Settings/AppActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export function AppActions() {
}
</AppActionsButton>
<StartTooltip />
<AppActionsButton opened={false} open={onOpenWallets} label="Wallets panel">
<AppActionsButton opened={false} open={onOpenWallets} label={t('actions.openWalletsPanel')}>
<WalletIcon fontSize="large" />
</AppActionsButton>
<AppActionsButton opened={false} open={onOpenMapOptions} label="Map Options panel">
<AppActionsButton opened={false} open={onOpenMapOptions} label={t('actions.openSettingsPanel')}>
<SettingsIcon fontSize="large" />
</AppActionsButton>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Settings/AppActionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function AppActionsButton({
<>
{
!opened &&
<Tooltip label={"Open " + label}>
<Tooltip label={label}>
<ActionIcon size="xl" aria-label={label} onClick={open} className={`p-4 mb-2 mr-2 ${cssClass}`} color={color}>
{children}
</ActionIcon>
Expand Down
18 changes: 10 additions & 8 deletions frontend/src/components/Settings/Settings/MapMarkerOpacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import OpacityIcon from '@mui/icons-material/Opacity';
import { useAppDispatch, useAppSelector } from "../../../hooks/useInitStore";
import { setMarkerOpacity } from "../../../store/mapOptions/mapOptionsReducer";
import { selectMarkerOpacity } from "../../../store/mapOptions/mapOptionsSelector";
import { useTranslation } from "react-i18next";

export function MapMarkerOpacity() {
const { t } = useTranslation('common');
const dispatch = useAppDispatch();
const markerOpacity = useAppSelector(selectMarkerOpacity);

Expand All @@ -17,18 +19,18 @@ export function MapMarkerOpacity() {
<Grid.Col span={12}>
<h3 className="text-base font-semibold leading-7">
<OpacityIcon className="inline-block mr-2" />
Markers opacity
{ t('settings.markersOpacity') }
</h3>
</Grid.Col>
<Grid.Col span={12} className="mt-4">
<Slider
step={.2}
min={.2}
max={1}
defaultValue={markerOpacity}
thumbLabel="Map markers opacity"
onChangeEnd={onOpacityChange}
/>
label={(value) => `${value * 100}%`}
step={.2}
min={.2}
max={1}
defaultValue={markerOpacity}
thumbLabel={t('settings.mapMarkersOpacity')}
onChangeEnd={onOpacityChange} />
</Grid.Col>
</Grid>
)
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/Settings/StartTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export function StartTooltip() {
const { t } = useTranslation('common', { keyPrefix: 'extra' });
const wallets = useAppSelector(selectWalletAddresses);

// TODO: Only display if option is enabled
return (
wallets && wallets.length <= 0 ? (
<div className="text-black bg-white p-4 rounded-lg min-h-14 text-center drop-shadow-md mr-6">
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/i18next/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"edit": "Edit",
"delete": "Delete",
"cancel": "Cancel",
"copyUrl": "Copy URL"
"copyUrl": "Copy URL",
"openWalletsPanel": "Open Wallets Panel",
"openSettingsPanel": "Open Settings Panel"
},
"settings": {
"language": "Language",
Expand All @@ -55,7 +57,9 @@
"chf": "Swiss franc (CHF)",
"refreshData": "Refresh data",
"french": "French",
"english": "English"
"english": "English",
"markersOpacity": "Markers Opacity",
"mapMarkersOpacity": "Map Markers Opacity"
},
"wallet": {
"wallets": "Wallets",
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/i18next/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"edit": "Modifier",
"delete": "Supprimer",
"cancel": "Annuler",
"copyUrl": "Copier URL"
"copyUrl": "Copier URL",
"openWalletsPanel": "Ouvrir la configuration des portefeuilles",
"openSettingsPanel": "Ouvrir les paramètres"
},
"settings": {
"language": "Langue",
Expand All @@ -55,7 +57,9 @@
"chf": "Franc suisse (CHF)",
"refreshData": "Rafraîchir les données",
"french": "Français",
"english": "Anglais"
"english": "Anglais",
"markersOpacity": "Opacité des marqueurs",
"mapMarkersOpacity": "Opacité des marqueurs sur la carte"
},
"wallet": {
"wallets": "Portefeuilles",
Expand Down
Loading