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

[Bug]: change localized to Chinese, all the naivgationView's text have changed except unit text #4581

Closed
sunhongjihaha opened this issue Jan 10, 2024 · 1 comment · Fixed by #4595
Labels
bug Something isn’t working

Comments

@sunhongjihaha
Copy link

sunhongjihaha commented Jan 10, 2024

Mapbox Navigation SDK version

2.17.0

Steps to reproduce

1.change routeOptions.locale to chinese.
2.navigationView's text have changed but except unit text, it always display previous language.
3.I used InstructionsBannerView as top banner, the distanceLabel used distanceFormatter's locale, but this value just set once at naivigationView first lanuch,when I changed language, back to navigationView, it also use first value, it did't update,so I try to set new value to distanceFormatter's locale, but distanceFormatter is internal. so can you change distanceFormatter authority from internal to open or public?
or other ways to update distanceFormatter locale.
thank you so much

Expected behavior

unit text change to 米

Actual behavior

unti text still mi

Is this a one-time issue or a repeatable issue?

repeatable

@sunhongjihaha sunhongjihaha added the bug Something isn’t working label Jan 10, 2024
@kried
Copy link
Contributor

kried commented Feb 8, 2024

Hi @sunhongjihaha

DistanceFormatter uses the nationalizedCurrent locale. So it uses the preferred language on the device. You can add Chinese localization to your app to support Chinese distance units.

Screenshot 2024-02-08 at 19 18 16

You can also use a custom view navigation controller with any type of top banner. You can find the code example here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants