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

refactor: removing texts (part 6) #315

Merged
merged 4 commits into from
Dec 18, 2023
Merged

refactor: removing texts (part 6) #315

merged 4 commits into from
Dec 18, 2023

Conversation

amabelleS
Copy link
Collaborator

Description

Removed from pointTypeToDescription - Notice - I did import { t } from 'i18next'. because I used it in an object, not react component.

DELETED texts.ts!

@amabelleS amabelleS requested a review from NoamGaash as a code owner December 16, 2023 22:42
Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this PR!
I believe we don't really need the translation module in this file, would you consider removing it?

@@ -58,7 +58,7 @@ type LabeledPointProps = {
} & PointProps

export const LabeledPoint = ({ timestamp, top, type }: LabeledPointProps) => {
const timeDisplay = timestamp.format(TEXTS.time_format)
const timeDisplay = timestamp.format(t('time_format'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const timeDisplay = timestamp.format(t('time_format'))
const timeDisplay = timestamp.format('time_format')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can pass the time format directly = HH:mm:ss. If we pass it like 'time_format' this is what we get:
image

I think I have seen use of the translation modal in another place, for formatting time. If so maybe it should be a constant somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, it's weird to find it in the translation file, you're right. it can simply be a constant

Comment on lines 28 to 30
[PointType.GTFS]: t('timestamp_gtfs'),
[PointType.SIRI]: t('timestamp_siri'),
[PointType.TARGET]: t('timestamp_target'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[PointType.GTFS]: t('timestamp_gtfs'),
[PointType.SIRI]: t('timestamp_siri'),
[PointType.TARGET]: t('timestamp_target'),
[PointType.GTFS]: 'timestamp_gtfs',
[PointType.SIRI]: 'timestamp_siri',
[PointType.TARGET]: 'timestamp_target',

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think we need the translation modal, this is the result if we remove it from the first two:
image

@@ -1,4 +1,4 @@
import { TEXTS } from 'src/resources/texts'
import { t } from 'i18next'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { t } from 'i18next'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not remove the i18next modal, because I'm still using it in pointTypeToDescription.

@amabelleS amabelleS requested a review from NoamGaash December 17, 2023 17:00
@NoamGaash NoamGaash force-pushed the removing-texts_part6 branch from b92f91a to 39c34a4 Compare December 17, 2023 18:11
@NoamGaash
Copy link
Member

@amabelleS please consider this change #321

@NoamGaash NoamGaash changed the title Removing texts part6 refactor: removing texts (part 6) Dec 17, 2023
@NoamGaash NoamGaash merged commit b9c58f2 into main Dec 18, 2023
14 checks passed
@NoamGaash NoamGaash deleted the removing-texts_part6 branch December 18, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants