问题描述
我正在设置此新的Google Places API-> com.google.android.libraries.places:places:1.1.0但是我找不到为该api提供的结果设置语言的语言.
I'm setting up this new google places api --> com.google.android.libraries.places:places:1.1.0 but I'm unable to find to set the language for results provided by this api.
当我输入一些关键字时,它仅使用少数几个关键字就以本地语言印地语"(印度语)显示结果,但这样做通常会显示正常的英语结果.
when I input some keywords it shows result in Local Language "Hindi"(Indian Language) only in few keywords it is doing this but in general it shows normal English results.
有以下关键字在印地语上显示结果:-
There is the following keyword on which it shows result in Hindi:-
关键字:"Rohini Sector 11"
Keyword: "Rohini Sector 11"
输出:244,位于G3S CINEMA HALL后面,से11,印度,印度110085,印度,
Output: 244, behind G3S CINEMA HALL, सेक्टर 11, रोहिणी, दिल्ली 110085, दिल्ली, India
FindAutocompletePredictionsRequest.
FindAutocompletePredictionsRequest request =
FindAutocompletePredictionsRequest.builder()
// Call either setLocationBias() OR setLocationRestriction().
//.setLocationBias(bounds)
.setCountry("IN")
.setTypeFilter(TypeFilter.REGIONS)
.setSessionToken(token)
.setQuery(constraint.toString())
.build();
Task<FindAutocompletePredictionsResponse> autocompletePredictions = placesClient.findAutocompletePredictions(request);
我希望此api的输出如下:
I expect the output of this api like:
关键字:"Rohini Sector 11"
Keyword: "Rohini Sector 11"
产出:244,位于印度德里Rohini的11区,G3S CINEMA HALL后面,110085
Output: 244, behind G3S CINEMA HALL, Sector 11, Rohini, Delhi 110085, Del India
推荐答案
当前似乎无法实现,但是Google的问题跟踪器中对此功能有一些功能要求,建议您加星标以增加知名度并订阅以后的通知:
It looks like this is not currently possible, but there are feature requests for this in Google's Issue Tracker which I recommend starring to increase visibility and subscribe to future notifications:
https://issuetracker.google.com/issues/35830937
https://issuetracker.google.com/issues/63829150
希望这会有所帮助!
这篇关于如何在com.google.android.libraries.places:places中设置语言限制:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!