Geocode api address of the map in the local language

I am new to Google Apis. I tried to get the full address for the search keyword using this

http://maps.googleapis.com/maps/api/geocode/json?address=surat&sensor=false 

using this i got a result like this

 { "results" : [ { "address_components" : [ { "long_name" : "Surat", "short_name" : "Surat", "types" : [ "locality", "political" ] }, { "long_name" : "Surat", "short_name" : "Surat", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Gujarat", "short_name" : "GJ", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "India", "short_name" : "IN", "types" : [ "country", "political" ] } ], "formatted_address" : "Surat, Gujarat, India", "geometry" : { "bounds" : { "northeast" : { "lat" : 21.2705834, "lng" : 72.9432106 }, "southwest" : { "lat" : 21.0478169, "lng" : 72.70155579999999 } }, "location" : { "lat" : 21.1702401, "lng" : 72.83106070000001 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 21.2705834, "lng" : 72.9432106 }, "southwest" : { "lat" : 21.0478169, "lng" : 72.70155579999999 } } }, "types" : [ "locality", "political" ] } ], "status" : "OK" } 

So, I get the address, but I want these adders in the local language.

For example, for the above, I want an address in Hindi, but if I am looking for Berlin, then I want an address in German.

Does anyone know how this is possible.

Thanks.

+6
source share
2 answers

Unfortunately, it is not possible to get results automatically in the language of the results.

As a workaround, if you know in advance the country you are looking for, then you can get the results in that country language by adding &language=XX at the end of your query:

See the SO question. Google Maps v3.5 Geocoding Variant

Here for your request in Hindi:

 http://maps.googleapis.com/maps/api/geocode/json?address=surat&sensor=false&language=hi 

Supported languages: https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1 (from here )

+3
source

As far as I understand, Google Map address data is in English. Address search completion will match the text in the language you provide. There is no attribute to control the output language.

+1
source

Source: https://habr.com/ru/post/975189/


All Articles