Google Places Changing AutoFill Tips and Results Language?

https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete

I have a similar page with the google demo above. Please note that the location input field has a "Enter Location" prompt. How to change the language of this hint? And how to change the language of returning results? I think both of them go to the same setting?

+3
google-places-api
source share
1 answer

According to the documentation:

"The API detects the user's browser settings and sets the language correctly. You can override the language in the APIs."

The placeholder for the input field will automatically change depending on the language settings of the browser agent.

You can also override automatic language detection by setting the language parameter in the bootstrap request to a supported language .

eg.

 <script src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=ja"></script> 
+9
source share

All Articles