Select to view content in your preferred language

How to change direction widget language

5653
8
04-13-2014 12:38 PM
AlexCartio
New Contributor
Hi,
I will change the language of directon widget,I mean the words of red underline in this image, image link
But,i search in locale language folder and i cant find any word of direction widget(words of red underline in attachment)!!!
I try to change language of direction in "DirectionsWidget.xml"  with "<directionslanguage>" tag, but i cant change it!

Q: Is there any way that change language the words(in attachment image) by tags in DirectionsWidget.xml or by action script or ...?
Tags (2)
0 Kudos
8 Replies
RichardFairhurst
MVP Alum
Hi,
I will change the language of directon widget,I mean the words of red underline in this image, image link
But,i search in locale language folder and i cant find any word of direction widget(words of red underline in attachment)!!!
I try to change language of direction in "DirectionsWidget.xml"  with "<directionslanguage>" tag, but i cant change it!

Q: Is there any way that change language the words(in attachment image) by tags in DirectionsWidget.xml or by action script or ...?


I don't use Flex, Network analyst or cultural language localization, so I may be of no help here.  However, did you use the Directions tool for na mentioned here?  It appears you need to specify the language as the seventh parameter of the tool and have a language packet installed on your machine or server prior to generating the directions.  I am not sure what exact string the language parameter requires for any other languages, but if you have a language packet installed the help suggests it will provide some kind of drop down to help you apply it.  So I am guessing something like the following would create directions in German:

import arcpy
arcpy.na.Directions("Route","XML","C:/temp/Route_Directions.xml","Kilometers",
                    "REPORT_TIME","Minutes", "German")

If this is not helpful, I apologize for my ignorance of the subject, but hopefully this will be of some use.  In any case, this is all I can offer in response to your private message requesting help.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alex,

   The directionslanguage tag in the RouteWidget.xml is all you need to change. So when you say you changed it can you share your RouteWidget.xml so your change can be verified for the correct syntax.
0 Kudos
ScottDavis6
Deactivated User

Hi Robert

Where is the RouteWidget.xml and how I changed to the words that does not exist in default languages like persian?

thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Scott,

    The routes language can be set using this tag in the xml

<directionslanguage>nl-NL</directionslanguage>

Here are the supported languages:

"directionsSupportedLanguages": [

  "ar",

  "cs",

  "de",

  "es",

  "et",

  "fr",

  "he",

  "it",

  "ja",

  "ko",

  "lt",

  "lv",

  "nl",

  "pl",

  "pt-BR",

  "pt-PT",

  "ru",

  "sv",

  "tr",

  "zh-CN",

  "en"

]

ScottDavis6
Deactivated User

Hi, Robert

I appreciate for your answer.

1.I search for "RouteWidget.xml" in my hard drive (specially in api folder) but I can not find such file name. Could you guide me where the "RouteWidget.xml" file is?

2. Another question is what can we do for unsupported languages  like Persian. I would be happy that find a file to hard code the directions instruction(like  "go forward" or "start at" )into that. I mean the red line expressions in the following picture.

languageChangeDirection.JPG

best regards.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Scott,

   You asked

Where is the RouteWidget.xml

So I assumed that you where talking about my custom Route Widget for Flex Viewer. Based on the image I see that you are actually talking about the Directions widget. so it would be Directions.xml (Assuming that you are talking about using Flex Viewer). All you need to do is add the xml tag I posted earlier to change the directions to one of the supported languages. Your only option for adding a unsupported language is to publish your own route service on your own server using your own data. You can not add a language to a service that is hosted by esri route service.

ScottDavis6
Deactivated User

Thank you  very much. I am using ArcGIS api for JavaScript. Can you guide me.

And what do you mean by "to publish your own route service on your own server"?

Does it mean that I must not use arcgis server?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Scott,

   You are posting to the ArcGIS Viewer for Flex forum Space. If this question is actually about the directions dijit in the JS API then you need to ask this question in the JS API forum space.

"to publish your own route service on your own server" means that if you want to support a language that is not currently supported in the list of languages I provided earlier than you are out of luck unless you want to publish your own network analyst route service using your own data to your own ArcGIS Server.

0 Kudos