mapbox / mapbox/mapbox-navigation-android

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

Open
#3,667 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature jira-sync-complete UI
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/mapbox/mapbox-navigation-android/blob/master/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/summary/SummaryBottomSheet.java#L238) with system locale.
- `DistanceFormetter` in `InstructionView` is initialized [here](https://github.com/mapbox/mapbox-navigation-android/blob/master/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/instruction/InstructionView.java#L570) with system locale.
- `TimeFormatter` in `SummaryBottomSheet` is initialized [here](https://github.com/mapbox/mapbox-navigation-android/blob/master/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/summary/SummaryModel.java#L36) with voiceLocale in response of directions API if possible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the formatter initialization points in libnavigation-ui/src/main/java/com/mapbox/navigation/ui/summary/SummaryBottomSheet.java, InstructionView.java, and SummaryModel.java. Reproduce the issue using an English system locale and a Directions API language of "ja". Done means the remaining distance and time use the same locale, with tests or verification covering that scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
internationalization, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.