google.maps.places.Autocomplete language output

后端 未结 2 1492

I am using google.maps.places.Autocomplete object and always get results in Ukrainian language.

I am loading library like that

http://maps.google.com/maps/api/js?s

相关标签:
2条回答
  • 2021-02-19 04:57

    According Docs

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

    That means, that the input will change according user language on the browser

    try on the script tag.

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

    take a look at this list of languages

    Edit:

    Try setting this on language parameter

    language=ru-RU
    
    0 讨论(0)
  • 2021-02-19 05:04

    Have you tried language=ru instead of language=ru-RU? This works for me. For example, you can input address to Autocomplete in any supportable language, but autocomplete.getPlace() will return result in language from parameter and in case of Russian only ru works.

    Have a look also at table of languages: https://developers.google.com/maps/faq#languagesupport

    There is no ru-RU, only ru.

    0 讨论(0)
提交回复
热议问题