Hi All,
Is there any way by using Nokia Maps and ReverseGeocodeQuery API to retrieve location details such as country name and street details in language other than "English" such as "Arabic" ?
Hi All,
Is there any way by using Nokia Maps and ReverseGeocodeQuery API to retrieve location details such as country name and street details in language other than "English" such as "Arabic" ?
Hello,
it's done automatically, if your phone is using the french language you'll get french name and street, if a name don't exist in a specified language you will get it in the universal one (english).
PS : I don't know if you can force it to use a language programmatically, maybe in the OnQueryCompleted doing something like e.Result.ToString( new System.Globalization.CultureInfo("ar") ) but I didn't test if it works.
Thanks Loukt
it worked as you expected when I changed phone language but the other way of forcing that way didn't work
Is there any other since the data itself is available at Nokia server side ?Code:MapAddress address = e.Result[0].Information.Address; CurrentLocTextBlock.Text = "Current Location: City " + address.City.ToString(new System.Globalization.CultureInfo("ar-EG"));
as Loukt mentions, ReverseGeocodeQuery automatically returns the address in the language the phone is set to, it's a simple API and doesn't have many options.
If you want to go the custom route, which will require writing more code but will give you more flexibility, then I'd recommend the Google Geocoding API. A language can be specified as part of the paramater.
I'd recommend making a JSON request with WebClient/GZipWebClient and use ServiceStack.Text for the JSON parsing.
You can try and change the thread culture at the beginning of the app. This can only be done at first launch, and if the user want to change the location will have to exit the app and start again.
On the method:
Add this:Code:private void InitializePhoneApplication()
pt-PT stands for Portuguese. You can try others.Code:Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-PT"); Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
Please mind that I didn't tested this with the maps controls. Let us know hot it goes.
Cheers
João Cardoso
Thanks João
I've tried your solution it didn't work although it recognizes the Arabic language in my case and it's even changed the direction of app from left to right to "right yo left" but it still shows data in English language (Default or currently set settings)
I afraid that Nokia API for Maps working on OS level not application level you know any anfo about that ??
Tried myself and I can see that it still defaults to the language of the OS.
Then only option I can think of is for you to use translation. Its a bit of a "hack" but I've seen similar implementations and while not perfect, are usually a good compromise.
You can have a jumpstart on the subject here: http://blogs.msdn.com/b/translation/...owsphone8.aspx
Edit: Just realized something. What you want is to have the street writen in Arabic, not translated to Arabic, right?
Cheers
João Cardoso
I think he wants the name of the street/city in arabic.
Since the native ReverseGeoCode API uses the system language (which is not acceptable in your case) I suggest you use the Nokia Restful Api (which wil require internet access) and add the Accept-Language Parameter:
You'll find the reverse geocode data Under the "context" tagCode:http://demo.places.nlp.nokia.com/places/v1/discover/here?tf=plain&size=10&at=37.7851%2C-7.4047&app_code=NYKC67ShPhQwqaydGIW4yg&app_id=demo_qCG24t50dHOwrLQ&Accept=Application/json&Accept-Language=ar-ma
As you said that what I wanted but this Api seems not powerful enough and completed as native ReverseGeoCode the other one returns postal code and street names nearly all data in correct language plus I'm afraid that Nokia retiring that restful for sake of newly Here maps.
Any Info how I can use this service in case i decided using it ??