Google Geocoding API returns wrong language in response

余生颓废 提交于 2019-12-09 06:32:10

问题


My project requests Geocoding API for coordinates and correct full addresses in Odessa, Ukraine.

I could request response in Russian or Ukrainian language adding language=ru (language=uk) parameter to the HTTP request. Starting today I get street name in Ukrainian in response, no matter which language I specify in request.

Examples.

Request for Russian: https://maps.googleapis.com/maps/api/geocode/json?address=Пушкинская, Одесса, Украина&language=ru

Relevant part of the response:

"results" : [
  {
     "address_components" : [
        {
           "long_name" : "Пушкінська вулиця",
           "short_name" : "Пушкінська вулиця",
           "types" : [ "route" ]
        },
        {
           "long_name" : "Приморський район",
           "short_name" : "Приморський район",
           "types" : [ "sublocality_level_1", "sublocality", "political" ]
        },
        {
           "long_name" : "Одеса",
           "short_name" : "Одеса",
           "types" : [ "locality", "political" ]
        },
        {
           "long_name" : "Одесский горсовет",
           "short_name" : "Одесский горсовет",
           "types" : [ "administrative_area_level_3", "political" ]
        },
        {
           "long_name" : "Одеська область",
           "short_name" : "Одеська область",
           "types" : [ "administrative_area_level_1", "political" ]
        },
        {
           "long_name" : "Украина",
           "short_name" : "UA",
           "types" : [ "country", "political" ]
        }
     ],

Please note, that "country" and "administrative_area_level_3" fields are in Russian, as they should be, but everything else is in Ukrainian.

If I use language=uk all fields in the response are returned in Ukrainian language (as intended).

I suppose someone at Google merged Russian and Ukrainian lists, and there nothing I can do to get Russian names back on my end. So the question is more about where I should report this bug?


回答1:


You can report a geo-coding api issue here.

Hit "New Issue," and under "Template" select "Geocoding API - Bug."

Good luck.




回答2:



I used this
https://maps.googleapis.com/maps/api/geocode/json?address=Пушкинская,%20Одесса,%20Украина&language=uk

and the response is



for
https://maps.googleapis.com/maps/api/geocode/json?address=Пушкинская,%20Одесса,%20Украина&language=ukr


I get this response



if i use

https://maps.googleapis.com/maps/api/geocode/json?address=Пушкинская,%20Одесса,%20Украина&language=en

I get this response



来源:https://stackoverflow.com/questions/27049068/google-geocoding-api-returns-wrong-language-in-response

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