How to specify the language for the response data?
E.g. the response of any request should always be in a specific language e.g. English, even if the request contains the French city name like Bruxelles, I would like "Brussels" as the response.
Is this possible?
Thanks, T
All the requests have a language parameter.
Thank you for your response. Yes I have noticed the Google maps API has a language and a region parameter but none seem to work properly. I have 2 questions/issues here:
- how to specify the language in the Java API?
GeoApiContext.Builder().language(String language) would be great but haven't found it.
GeoApiContext.Builder().param(String key, String value) would be great but haven't found it.
- how to always get the correct address in the language specified? Here is the issue in more detail:
I always get the actual Dutch version but not the English version even when I have no Dutch version configured in Chrome.
Tested it in Chrome directly: Example 1:
GIVEN
Language French
Google Chrome ONLY set to use English language
WHEN
https://maps.googleapis.com/maps/api/geocode/json?key=[APIKEY]&address=parvis+st+gudule+5+-+1000+Brussels%2C+Belgium+%28Belgium%29&language=fr
THEN
expect Bruxelles BUT returns "Brussel" Flemish version.
Example2:
GIVEN
Language English
Google Chrome ONLY set to use English language
WHEN
https://maps.googleapis.com/maps/api/geocode/json?key=[APIKEY]&address=parvis+st+gudule+5+-+1000+Brussels%2C+Belgium+%28Belgium%29&language=en
THEN
expect Brussels BUT returns "Brussel" Flemish version.
The country IS translated correctly but not the city.
I'm thinking this needs to be done in another way? Any help is welcome.
Here is the DirectionsApiRequest language parameter Javadoc. That's how you pass through the language to the web services.
HI, thanks for the feedback. How did I not see that? Even with the parameter being set to e.g. e-US, the response will always be in Dutch (except the country as that is in the correct language of the parameter but everything else keeps being returned in Dutch) I will just send a request to Google Translate API which returns what I need.
That sounds like a bug. Can you raise it on the appropriate web service bug tracker?