Didier Sampaolo
Didier Sampaolo

Reputation: 2823

Limit places autocomplete to a certain language

I'm using Google Maps API 3 (Places Librairy) to allow the users of a website to attach a location to photos they upload.

I started using this example : https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

Everything works like a charm except that : I would like the resultsets to be in a specific language (French). Please note that I don't want to limit the results to a specific area. I'd like to translate the results, ie have "Pékin, Chine" instead of "Beijing, China".

Would you mind explaining me what to change in the code, or point me to the right direction ?

Thanks a lot !

Upvotes: 1

Views: 1908

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117334

Add a language-parameter when including the maps-API:

https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&language=fr

https://developers.google.com/maps/documentation/javascript/basics#Language

Upvotes: 4

Related Questions