Skip to content

Commit

Permalink
Added i18n to the history components
Browse files Browse the repository at this point in the history
  • Loading branch information
Senior-ai committed Jan 1, 2024
1 parent 0eb26b4 commit 50355c2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"loading_routes": "Charging routes",
"loading_stops": "Charging stop stations",
"loading_gaps": "Charging trip gaps",
"timestamp_list": "A list of all stop times in the chosen station",
"timestamp_target": "⌚ Search time",
"timestamp_gtfs": "🕛 Planned stop time",
"timestamp_siri": "🚌 Actual stop time",
Expand All @@ -38,6 +39,7 @@
"dashboard_tooltip_content": "A GPS is attached to every line in Israel that reports the location of the bus every few moments.\nSo what is a missed trip? This is a trip that was planned, but was not reported to have taken place in the GPS data. You can see it in the app for example, but when you wait at the station, it will never arrive",
"worst_lines_page_title": "Least Efficient Lines",
"rides_planned": "planned trips",
"rides_history": "Trips History",
"rides_actual": "Trips out",
"dashboard_page_graph_title": "Exit percentages of total trips by time",
"from_date": "dated",
Expand Down
2 changes: 2 additions & 0 deletions src/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"loading_routes": "מסלולי נסיעה בטעינה",
"loading_stops": "תחנות עצירה בטעינה",
"loading_gaps": "פערי נסיעות בטעינה",
"timestamp_list": "רשימת זמני עצירה בתחנה שנבחרה",
"timestamp_target": "זמן החיפוש ⌚",
"timestamp_gtfs": "זמן עצירה מתוכנן 🕛",
"timestamp_siri": "זמן עצירה בפועל 🚌",
Expand All @@ -38,6 +39,7 @@
"worst_lines_page_title": "הקווים הגרועים ביותר",
"rides_planned": "נסיעות שתוכננו",
"rides_actual": "נסיעות שיצאו",
"rides_history": "היסטוריית נסיעות",
"dashboard_page_graph_title": "אחוזי יציאה מסך הנסיעות לפי זמן",
"from_date": "מתאריך",
"to_date": "עד תאריך",
Expand Down
6 changes: 5 additions & 1 deletion src/pages/components/timeline/TimelineBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SiriVehicleLocationWithRelatedPydanticModel,
} from 'open-bus-stride-client'
import { Coordinates } from 'src/model/location'
import { useTranslation } from 'react-i18next'

const COLUMN_WIDTH = 140
export const PADDING = 10
Expand Down Expand Up @@ -42,6 +43,7 @@ type TimelineBoardProps = {
}

export const TimelineBoard = ({ className, target, gtfsTimes, siriTimes }: TimelineBoardProps) => {
const { t } = useTranslation()
const gtfsDates = gtfsTimes.map((t) => t.arrivalTime!)
const siriDates = siriTimes.map((t) => t.recordedAtTime!)
const gtfsRange = getRange(gtfsDates)
Expand All @@ -63,7 +65,9 @@ export const TimelineBoard = ({ className, target, gtfsTimes, siriTimes }: Timel
)
return (
<StyledContainer>
<h4>זמן החיפוש ⌚: {target.format('DD/MM/yyyy HH:mm:ss')}</h4>
<h4>
{t('timestamp_target')} {target.format('DD/MM/yyyy HH:mm:ss')}
</h4>
<Container className={className}>
<StyledTimeline
timestamps={gtfsTimes}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/historicTimeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ const TimelinePage = () => {

return (
<PageContainer>
<Title level={3}>הסטורית נסיעות</Title>
<Title level={3}>{t('rides_history')}</Title>
<Space>
<Alert message="רשימת זמני עצירה בתחנה שנבחרה" type="info" />
<Alert message={t('timestamp_list')} type="info" />
</Space>
<Grid container spacing={2} sx={{ maxWidth: INPUT_SIZE }}>
{/* choose date */}
Expand Down

0 comments on commit 50355c2

Please sign in to comment.