Skip to content

Conversation

fbarbe00
Copy link
Contributor

This pull request includes updates to the internationalization (i18n) files for multiple languages and improvements to the translation handling in the codebase.
A new t function fetches the translation based on the selected language, with a fallback to English if the translation is not available, or to the key name if it's not available in English.

@frodrigo
Copy link
Member

Please, again. Make small atomic commit and PR. It is more easy to accept small PR with a clear point. I still have too many doubt on what the PR contains and doubts and questions retain the whole changes.

@fbarbe00
Copy link
Contributor Author

@frodrigo I have added a commit and improved the commit messages.

@frodrigo
Copy link
Member

Where come from the new translation key ? And in especially 'Bike', 'Car', 'Foot', 'Train'

@fbarbe00
Copy link
Contributor Author

Where come from the new translation key ? And in especially 'Bike', 'Car', 'Foot', 'Train'

These are translations of common label for services. Currently, the default service (backend) is named Car (fastest), but I suggested renaming it to Car in #381 . The other labels are also included by default in the routers (except for Train) in #381 . I can see why you don't want to have them here, in which case I can just remove them and have the user manually translate each service name they add, but I thought it'd be a nice addition.

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

Is there anything blocking this PR?

Copy link
Member

@frodrigo frodrigo left a comment

Choose a reason for hiding this comment

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

Plase, keep the same code formating as original code.

@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

Please, can you remove "Train" from translation, there is no OSRM train profile in the main repository.

The default is named with "Car (fastest)" because the car profile can be used also as shortest. So it makes sense to keep "fastest". But you can also add "Car (shortest)" if you want.

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

I highly disagree with the naming of "Car (fastest)" or "shortest". This does not help the user in any way, and is only confusing in my opinion. What's the point of it?

Furthermore, cars can only be "faster" and "shorter" on longer distances, in many cities it is shorter and faster to take the bike or walk by foot for smaller distances.

fbarbe00 added 3 commits March 3, 2025 09:21
This introduces a new function t(), which can be called to retrieve a
translation for a certain key value in a certain language.
If no translation is found in the current language, it defaults to
english. If no english translation is found, it returns the given key.
This is to avoid displaying "undefined" or no message at all.
Allow translation of service labels to other languages
@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

Furthermore, cars can only be "faster" and "shorter" on longer distances, in many cities it is shorter and faster to take the bike or walk by foot for smaller distances.

I am agree with that. In practice we almost never drive a car on the shortest way.

But this project is the frontend of the OSRM backend, I think it should be able show the capabilities.

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

I'm afraid I don't understand your point. What exactly do you mean by "Fastest" and "Shortest"? I was (and still am) personally really confused when I saw that in the interface. Does it mean it's faster to compute? Faster than what?

@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

I'm afraid I don't understand your point. What exactly do you mean by "Fastest" and "Shortest"? I was (and still am) personally really confused when I saw that in the interface. Does it mean it's faster to compute? Faster than what?

That about computing the path that take less time do drive, vs the path that take less km to drive.

https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/car.lua#L19-L24

(the routability is almost the as duration)

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

I see. I'm a little confused actually. The readme file says this repository is "the frontend served at https://map.project-osrm.org/". I'm guessing you're referring to this with website.

However, the website currently displays "Car" and not "Car (fastest)" or shortest: https://map.project-osrm.org/

Are you sure you'd like me to put it back to how it was before.

@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

I see. I'm a little confused actually. The readme file says this repository is "the frontend served at https://map.project-osrm.org/".

That no more the case.

Are you sure you'd like me to put it back to how it was before.

I prefer to stay conservative when I am not sure.

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

I am still really struggling to understand this. Three messages ago you claimed this "is the frontend of the OSRM backend" and that's the reason it should be changed. You're now saying that's not true, but that it shouldn't be changed because of "staying conservative", although we seem to agree that this wording doesn't make much sense and just confuses the user?

Why shouldn't it then be "Bike (fastest)" and "Foot (fastest)"? It makes no sense to have fastest there in my opinion.

Please, make it a little easier for new contributers to contribute to this project.

@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

I am still really struggling to understand this. Three messages ago you claimed this "is the frontend of the OSRM backend" and that's the reason it should be changed.

Yes, that the frontend of the project.

You're now saying that's not true,

But the demo use a fork of the frontend, as there is no more proper demo instance.

although we seem to agree that this wording doesn't make much sense and just confuses the user?

No, that make few sense is to drive a car using shortest distance route. But, the wording is about what the computation is.

@fbarbe00
Copy link
Contributor Author

fbarbe00 commented Mar 3, 2025

Shouldn't this reflect the demo website? If the decision was made there to remove the "fastest", it's probably best to reflect it here. Otherwise, I guess there should also be "Bike (fastest)" and "Walk (fastest)". Which seems to be redundant information.

Side question: are you the sole maintainer of this repository? Isn't there anyone else we could ask for a third opinion?

@frodrigo
Copy link
Member

frodrigo commented Mar 3, 2025

Shouldn't this reflect the demo website? If the decision was made there to remove the "fastest", it's probably best to reflect it here

Ok, let remove "fastest"...

Otherwise, I guess there should also be "Bike (fastest)" and "Walk (fastest)".

No, that variants does not exists.

Side question: are you the sole maintainer of this repository? Isn't there anyone else we could ask for a third opinion?

There is others. But as I say before, missing of time or interest to this subproject.

I even does not use this project myself.

@frodrigo frodrigo merged commit ef769ed into Project-OSRM:gh-pages Mar 3, 2025
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