Skip to content

Commit

Permalink
Add a trolleybus category
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak committed Dec 22, 2024
1 parent 945744a commit bca5d95
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,23 @@ import {
VisibilityOff,
} from '@mui/icons-material';

// TODO: Do this using the id-tagging-presets
const fmtCategory = (category: string) => {
switch (category) {
case 'tourism':
return t('publictransport.tourism');
case 'night':
return t('publictransport.night');
case 'car_shuttle':
return t('publictransport.car_shuttle');
case 'car':
return t('publictransport.car');
case 'commuter':
return t('publictransport.commuter');
case 'regional':
return t('publictransport.regional');
case 'long_distance':
return t('publictransport.long_distance');
case 'high_speed':
return t('publictransport.high_speed');
case 'bus':
return t('publictransport.bus');
case 'subway':
return t('publictransport.subway');
case 'unknown':
return t('publictransport.unknown');
default:
return category;
}
return (
{
tourism: t('publictransport.tourism'),
night: t('publictransport.night'),
car_shuttle: t('publictransport.car_shuttle'),
car: t('publictransport.car'),
commuter: t('publictransport.commuter'),
regional: t('publictransport.regional'),
long_distance: t('publictransport.long_distance'),
high_speed: t('publictransport.high_speed'),
bus: t('publictransport.bus'),
subway: t('publictransport.subway'),
trolleybus: t('publictransport.trolleybus'),
unknown: t('publictransport.unknown'),
}[category] || category
);
};

const ToggleCategory = ({
Expand Down
2 changes: 2 additions & 0 deletions src/components/FeaturePanel/PublicTransport/routes/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const categories = [
'car',
'car_shuttle',
'bus',
'trolleybus',
'unknown',
];

Expand All @@ -36,6 +37,7 @@ const PublicTransportDisplay = ({
'subway',
'commuter',
'regional',
'trolleybus',
'bus',
]);

Expand Down
1 change: 1 addition & 0 deletions src/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export default {
'publictransport.long_distance': 'Fernzüge',
'publictransport.high_speed': 'Hochgeschwindigkeitszüge',
'publictransport.bus': 'Bus',
'publictransport.trolleybus': 'Trolleybus',
'publictransport.subway': 'U-Bahn',
'publictransport.unknown': 'Unbekannter Typ',

Expand Down
1 change: 1 addition & 0 deletions src/locales/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export default {
'publictransport.long_distance': 'Long distance trains',
'publictransport.high_speed': 'High speed trains',
'publictransport.bus': 'Bus',
'publictransport.trolleybus': 'Trolleybus',
'publictransport.subway': 'Subway',
'publictransport.unknown': 'Unknown type',

Expand Down

0 comments on commit bca5d95

Please sign in to comment.