Skip to content

Commit

Permalink
Settings: Add metric/imperial switch (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak authored Nov 26, 2024
1 parent fca21c7 commit cf049e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/HomepagePanel/UserSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ export const UserSettingsDialog = ({ onClose, isOpened }: Props) => {
checked={userSettings['weather.enabled']}
/>
</ListItem>
<ListItem>
<ListItemText>{t('user_settings.is_imperial')}</ListItemText>
<Switch
color="primary"
edge="end"
onChange={(e) => {
setUserSetting('isImperial', e.target.checked);
}}
checked={userSettings.isImperial}
/>
</ListItem>
</List>
<PanelLabel>{t('user_settings.climbing')}</PanelLabel>
<List>
Expand Down
5 changes: 5 additions & 0 deletions src/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export default {
'user.my_ticks': 'Meine Begehungen',
'user.user_settings': 'Einstellungen',

'user_settings.general': 'Allgemein',
'user_settings.show_weather_widget': 'Zeige das Wetter an',
'user_settings.climbing': 'Klettern',
'user_settings.is_imperial': 'Nutze imperiale Einheiten',

'my_ticks.title': 'Meine Begehungen',
'my_ticks.route_name': 'Name',
'my_ticks.route_grade': 'Schweregrad',
Expand Down
1 change: 1 addition & 0 deletions src/locales/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default {
'user_settings.crag_view_layout_vertical': 'Side by side',
'user_settings.crag_view_layout_horizontal': 'Underneath',
'user_settings.crag_view_layout_auto': 'Auto (according to resolution)',
'user_settings.is_imperial': 'Use imperial units',

'my_ticks.title': 'My ticks',
'my_ticks.route_name': 'Name',
Expand Down

0 comments on commit cf049e9

Please sign in to comment.