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?sensor=true&libraries=places&language=ru-RU
how to pass parameters to autocomplete language?
var autocomplete = new google.maps.places.Autocomplete($("#google_places_ac")[0], {});
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
$scope.location = place.formatted_address;
// at that point $scope.location is in ukrainen, but I want Russian
$scope.$apply();
});
I've added image explains the problem. Text that squared with RED - is on Russian, text with Green - is on Ukraine. As you can see there is two different languages on the same map. Also input with Russian, and formatted language with Ukrainian. I believe this is a bug of Google map.s
It is currently not possible to restrict results to a specific locality. You can use bounds as you have done so above to bias results towards, but not restricted to places contained within the specified bounds. If you believe restriction by locality would be a useful feature please file a Places API - Feature Request.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With