mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

Locale mismatch between distance formatter and time formatter in SummaryBottomSheet and InstructionView

Open OttyLab opened this issue 4 years ago • 5 comments

Mapbox Navigation SDK version: v1.1.0

Steps to trigger behavior

  1. Set system locale English
  2. Query Directions API with setting other language like "ja"
  3. Remaining distance is shown as imperial units (system locale) while remaining time is shown as "min" (Japanese locale)

Expected behavior

Remaining distance and remaining time should use same locale.

Details

  • DistanceFomatter in SummaryBottomSheet is initialized here with system locale.
  • DistanceFormetter in InstructionView is initialized here with system locale.
  • TimeFormatter in SummaryBottomSheet is initialized here with voiceLocale in response of directions API if possible.

OttyLab avatar Oct 21 '20 13:10 OttyLab

@JunDai can you take a look at this when you have a chance? 🙏

Guardiola31337 avatar Oct 26 '20 20:10 Guardiola31337

it's related to the fix of https://github.com/mapbox/mapbox-navigation-android/issues/1990 I can check more soon.

JunDai avatar Oct 27 '20 08:10 JunDai

@OttyLab - thanks for using our SDK and reporting this issue.

Did you find this issue when you were using our NavigationView component? I would guess you were using the InstructionView and SummaryBottomSheet stand-alone widgets in your layout? In this case, there is an API setDistanceFormatter that would allow you to pass in a distanceFormatter during runtime.

I will revisit this piece and see if we can unify the locale for those three places.

JunDai avatar Oct 28 '20 09:10 JunDai

@JunDai Thanks, you are right. This is caused when I do NOT use NavigationVew and do NOT set DistanceFormatter by myself. (NavigationView set both formatter by using voice unit and there's no problem)

Therefore this is a feature request rather than a bug ticket. If SDK provides a way to set up both formatter in one place, it's straightforward.

OttyLab avatar Oct 29 '20 07:10 OttyLab

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 08 '21 09:04 stale[bot]