-
Notifications
You must be signed in to change notification settings - Fork 262
Improve translation #382
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
Improve translation #382
Conversation
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. |
6a75184
to
f33793d
Compare
@frodrigo I have added a commit and improved the commit messages. |
Where come from the new translation key ? And in especially 'Bike', 'Car', 'Foot', 'Train' |
f33793d
to
de5bc9a
Compare
These are translations of common label for services. Currently, the default service (backend) is named |
Is there anything blocking this PR? |
There was a problem hiding this 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.
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. |
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. |
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
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. |
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 |
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. |
That no more the case.
I prefer to stay conservative when I am not sure. |
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. |
Yes, that the frontend of the project.
But the demo use a fork of the frontend, as there is no more proper demo instance.
No, that make few sense is to drive a car using shortest distance route. But, the wording is about what the computation is. |
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? |
Ok, let remove "fastest"...
No, that variants does not exists.
There is others. But as I say before, missing of time or interest to this subproject. I even does not use this project myself. |
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.