I am working with Directions widget within Arcgis api 3.38, and actually Im trying to change the directions language from English to Frensh language.
so I have tried to work with "setDirectionsLanguage(locale)",
But Im not able to do it correctly... any help please it would be much appreciated.
This worked for me, but with a caveat.
According to the doc, this doesn't change the localization of the widget itself, just the language of the directions results coming from the REST API.
Specify the language used for the directions. The supported languages can be requested from either the Route Service REST API, or from the widget itself
Try in this sample.
Update the code like this.
directions.startup(); // after startup() directions.setDirectionsLanguage("fr");
This worked for me. I think that method has to be called after the startup() method.