eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
211 stars 175 forks source link

I am setting the voice language as PT_BR but it sounds like portuguese from portugal #308

Closed fabiolin closed 11 months ago

fabiolin commented 1 year ago

It should sound like portuguese from Brazil...

the code i am using below: MapBoxNavigationView( options: MapBoxOptions( initialLatitude: -23, initialLongitude: -46, zoom: 13.0, tilt: 60.0, // bearing: 0.0, enableRefresh: false, alternatives: true, voiceInstructionsEnabled: false, bannerInstructionsEnabled: true, allowsUTurnAtWayPoints: true, mode: MapBoxNavigationMode.drivingWithTraffic, // mapStyleUrlDay: "https://url_to_day_style", // mapStyleUrlNight: "https://url_to_night_style", units: VoiceUnits.metric, simulateRoute: false, longPressDestinationEnabled: false, language: "pt_BR"), onRouteEvent: _onRouteEvent, onCreated: (MapBoxNavigationViewController controller) async { _controller = controller; _controller?.initialize(); }),

eopeter commented 11 months ago

hmmm, that is strange. Does it do same on the latest version?

fabiolin commented 11 months ago

still have the sound in portuguese from portugal

ddiegosousa commented 11 months ago

@eopeter: I would like to resolve and contribute with you a possible solution. I believe your package "flutter_mapbox_navigation" uses mapbox.

To recognize the pt-BR voice (Brazilian language) in MAPBOX, I saw the problem resolved in the mapbox issue: https://github.com/mapbox/mapbox-navigation-android/issues/1758

In other words, to solve this br voice problem you must put in your code: new Locale("pt-BR")

If you use "pt_BR", mapBox will not recognize it, you must use "pt-BR".

I analyzed your code that uses Locale.getAvailableLocales(), it brings pt_BR and should send it to mapBox pt-BR

Could you analyze this issue?

eopeter commented 11 months ago

v0.2.1 containing the fix is published

ddiegosousa commented 11 months ago

@fabiolin I tested this fix from version v0.2.1 and it worked perfectly.

Update your package to this version