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

Routing directions mentioning that roads are unnamed #904

Closed
jase88 opened this issue Feb 21, 2015 · 13 comments
Closed

Routing directions mentioning that roads are unnamed #904

jase88 opened this issue Feb 21, 2015 · 13 comments
Labels
routing Related to the routing feature on the website

Comments

@jase88
Copy link

jase88 commented Feb 21, 2015

Directions made by car routes with OSRM are explicitly calling streets without names "unnamed".

image of routing directions with OSRM on osm.org - directing via unnamed road
see live: http://bit.ly/1FHR6O9

Unsure if this is a OSRM issue, but seems to be a frontend thing. osrm.at and osrm.at frontend2 is not mentioning unnamed roads.

this is confusing users (read some comments about this) and doesn't provide any valuable information

@tomhughes
Copy link
Member

All directions come directly from the upstream routing engine.

@jase88
Copy link
Author

jase88 commented Feb 22, 2015

So opening a issue at repository osrm-backend might be more expedient? Might this be configuration problem or are you getting directions directly from a OSRM server? I'm asking because OSRM is not listing "unnamed" in their frontend.

@tomhughes
Copy link
Member

We're using the project-osrm.org server.

@tomhughes tomhughes reopened this Feb 22, 2015
@tomhughes
Copy link
Member

It looks we are deliberately saying "unnamed" when the server doesn't provide a name while the OSRM UI leaves the name out - see https://github.com/openstreetmap/openstreetmap-website/blob/master/app/assets/javascripts/index/directions/osrm.js#L72.

@tomhughes tomhughes added the routing Related to the routing feature on the website label Jul 1, 2015
@tomhughes
Copy link
Member

I don't think mentioning the fact that the road has no name is a problem as such, but I've changed it to say unnamed road rather than (unnamed) which I think looks better.

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 8, 2015

I'm not sure if tomhughes@1729a68 causes some regressions here or if it's something completely different. At least when requesting route instructions with locale set to German, street names are no longer shown. English version looks ok, though.

On a second thought, all the translations except for English are lacking the variable %{name} now. This probably will take quite a while till it gets fixed on translatewiki, right?

Some reference screenshots:

English:
g2

German:
g1

Link to query: http://www.openstreetmap.org/directions?engine=osrm_car&route=51.5216%2C6.9292%3B51.4572%2C7.0115

@tomhughes
Copy link
Member

@mmd-osm the translations likely need updating.

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 8, 2015

Would it be complete nonsense to fall back to the old behaviour unless %{name} is present in the translation? I can imagine that it might take some time until all 50+ languages get an update. IMHO showing a name (possibly out-of-line) is probably still slightly better than showing no street name at all for the time being.

@tomhughes
Copy link
Member

No it wouldn't be nonsense, it would be a lot of work.

What I should really have done is to change the translation names, so that it would fallback to english until they were retranslated, but again it was a lot of work.

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 8, 2015

Thanks, I'm getting your point. I don't seem to find a way in the I18n lib to deal with missing variable names. I can only think of some crazy workarounds like the following (not tested) or even checking for %{name} in I18n.t(TURN_INSTRUCTIONS[instCodes[0]]. Maybe others have some better ideas to ease the transition phase without causing lots of work.

            var name = s[1] ? "<b>" + s[1] + "</b>" : I18n.t('javascripts.directions.instructions.unnamed');
            if (instCodes[0] === "11" && instCodes[1]) {
              instText += I18n.t('javascripts.directions.instructions.roundabout_with_exit', { exit: instCodes[1], name: name } );
            } else {
              var transl1 = I18n.t(TURN_INSTRUCTIONS[instCodes[0]], { name: name });
              var transl2 = I18n.t(TURN_INSTRUCTIONS[instCodes[0]]);
              if (transl1 === transl2)            // fallback to legacy mode where name variable is missing
                instText += transl2 + " " + name;
              else
                instText += transl1;
            }

@tomhughes
Copy link
Member

No, we are not doing anything crazy like that - apart from anything else we would never be able to remove it.

The old way was technically buggy anyway, because different language may need to put the road name in different places - glueing strings together is bad for i18n.

@tomhughes
Copy link
Member

I've pushed d28ae2a now to rename the strings.

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 9, 2015

Thanks a lot! The fallback to English looks way better now.

sbagroy986 pushed a commit to sbagroy986/openstreetmap-website that referenced this issue Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
routing Related to the routing feature on the website
Projects
None yet
Development

No branches or pull requests

3 participants