mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 318 forks source link

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

Open OttyLab opened 3 years ago

OttyLab commented 3 years ago

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

Guardiola31337 commented 3 years ago

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

JunDai commented 3 years ago

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

JunDai commented 3 years ago

@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.

OttyLab commented 3 years ago

@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.

stale[bot] commented 3 years ago

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.