Google Places Changing Auto-complete Hint & Result Language?

牧云@^-^@ 提交于 2019-12-07 15:50:33

问题


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

I have a similar page with above google places demo. Notice that the location input field has a hint of "Enter a location". How do i change the language of this hint? And how do i change the language of the results return? I guess both of them goes to the same setting?


回答1:


As per the documentation:

"The API detects the browser settings of the user and set the language appropriately. It is possible to override the language in the APIs."

The input field placeholder will change automatically depending on the users browser agent language setting.

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

E.G.

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


来源:https://stackoverflow.com/questions/13307199/google-places-changing-auto-complete-hint-result-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!