Project-OSRM / osrm-text-instructions

Text instructions from OSRM route responses
BSD 2-Clause "Simplified" License
90 stars 62 forks source link

American English and roundabouts #256

Closed 1ec5 closed 5 years ago

1ec5 commented 6 years ago

Issue

Added an American English localization that is programmatically derived from the international English localization. The English localization remains the default. The two localizations are identical, except for circular junction terminology. The English localization calls all circular junctions “roundabouts” – which is a change in favor of non-American usage – whereas the American English localization distinguishes between classical roundabouts as “traffic circles” and modern roundabouts as “roundabouts”. I think we could justify calling them all roundabouts in American English, but this is a slightly more conservative change that respects East Coast tradition.

This isn’t exactly a backwards-incompatible change, but clients that wish to retain some “traffic circle” usage should ensure the use of the en-US locale instead of relying on the en default.

Fixes #188.

Tasklist

/cc @danpaz @bsudekum

1ec5 commented 6 years ago

This isn’t exactly a backwards-incompatible change, but clients that wish to retain some “traffic circle” usage should ensure the use of the en-US locale instead of relying on the en default.

@danpaz reminded me that the language=en default (when the parameter is omitted) is quite entrenched in the Mapbox Directions API and perhaps other clients as well. I overlooked this possibility because the Mapbox Navigation SDK automatically specifies a full locale code including a region, such as en-US.

One possibility would be to fold the remaining “traffic circle” usage back into the en locale and create localizations for each of the major English locales (including GB, CA, AU, NZ, IN, and ZA). But even if we automate those locales using a transformation script, as this PR attempts to do, that’s a lot of duplication in the final package for relatively little gain.

155 would enable us to avoid duplicating the entire English localization and ship the package with “sparse” localizations that only override individual strings. In the meantime, we might want to consider paring back this PR to just replace “traffic circle” with “roundabout” everywhere until #155 gives us that extra flexibility.

andrewharvey commented 5 years ago

One possibility would be to fold the remaining “traffic circle” usage back into the en locale and create localizations for each of the major English locales (including GB, CA, AU, NZ, IN, and ZA). But even if we automate those locales using a transformation script, as this PR attempts to do, that’s a lot of duplication in the final package for relatively little gain.

Not sure if you could just create an en-gb, then symlink en-ca, en-au, etc all to en-gb until such time as they need to diverge?

1ec5 commented 5 years ago

Per chat with @danpaz, we’re going to change the wording to roundabout for all English locales, making an en-US locale unnecessary.

1ec5 commented 5 years ago

Circling back on this fix in #285.