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

front: fix translations for pathfinding error in itinerary #9729

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

RomainValls
Copy link
Contributor

closes #9728

@RomainValls RomainValls requested a review from a team as a code owner November 15, 2024 13:19
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

The error message still isn't human-readable for me:

out

I think we need to set message to t(`pathfindingErrors.${…}`) instead.

@@ -104,7 +104,8 @@
"not_found_in_tracks": "Voie manquante",
"not_enough_path_items": "Éléments manquants pour la recherche : Origine, Destination, Matériel roulant",
"pathfinding_failure": "Aucun chemin trouvé",
"rolling_stock_not_found": "Matériel roulant non trouvé"
"rolling_stock_not_found": "Matériel roulant non trouvé",
"the path goes over the same track multiple times": "Le chemin emprunte plusieurs fois la même voie"
Copy link
Member

Choose a reason for hiding this comment

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

Ah. This is not an error code, it's a human-readable error message. So I don't think this is a stable string we can rely on.

For pathfindingResult.error_type we have an error code and we can find a suitable translation. For pathfindingResult.core_error.message specifically, we should probably just pass the message as-is without going through translations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I was wondering. But if the app is set in french, the user will have a mixed french-english error message ?

Copy link
Member

Choose a reason for hiding this comment

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

If we do want to provide an error message in French, we could use pathfindingResult.core_error.type maybe? But there are many such error types (see core/osrd-reporting/src/main/java/fr/sncf/osrd/reporting/exceptions/ErrorType.java) so not sure it's a rabbit hole we want to jump into.

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.

Wrong translations for pathfinding errors in itinerary
2 participants