Project:Google Maps Tools
Version:6.x-2.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Is it possible to have the GMaps search results data in some other language rather than English? I mean is it possible to set other language for the GMAPS search results?

Comments

#1

I've got similar question: is there any possibility to display address in other language than English?
I mean instead of:
Polna, Warsaw, Mazovia, Poland
to have:
Polna, Warszawa, Mazowieckie, Polska (in Polish)

Thanks!

#2

What do you mean "search results"? Is it a view field or dou you mean the search snippets of fields?

#3

In my case: in the view field, when CCK Gmaps Address field is presented: I'd like the address to be presented in language other than English. Preferably: in the site language or even better: in the user who has added address browser language.

Under the 'admin/settings/gmaps' there is radio button 'Use site language'. I've changed it but didn't notice any difference.

Thanks for answer!

#4

Did you translate the texts at admin >> build >> translate interface (admin/build/translate)?

#5

Thanks, I didn't expected that address goes through t() function.
I don't think it is how I'd like it to work.

I was thinking that geonames returns (can return) localized address and it can be stored as such.

Thanks for help.

#6

Status:active» closed (fixed)

#7

Status:closed (fixed)» active

i would like to re-open this issue. just posted http://drupal.org/node/690242 because i thought it's a geonames issue, but the answer there seems to indicate that this might be a gmaps issue (not passing the "lang" param to geonames)?

"According to the geonames documentation for the "search" service at http://www.geonames.org/export/geonames-search.html - you can pass a language parameter:

lang
string ISO-636 2-letter language code; en,de,fr,it,es,... (optional)
place name and country name will be returned in the specified language. Default is English. Feature classes and codes are only available in English and Bulgarian. Any help in translating is welcome."

#8

Status:active» closed (fixed)

First, the project uses the Google Geocoder service, not the Geonames search service.

Second, the search results are forced to be in English, to make them translatable using drupal's built-in translation (t() function).

#9

hi xmarket,
just for me to understand it- what for is the dependency on geonames module then?
and thanks for a great module by the way!

#10

Version:5.x-1.x-dev» 6.x-2.x-dev
Status:closed (fixed)» active

reopen - sorry, I just don't get why english is forced. Any non-international site preffers native geo names. It's not possible to translate all names of cities (etc.) with t() function from EN to local language. And (mainly) it is not neccessary - we can get it from google in native language.

Solution/hack:
file: modules/gmaps/includes/gmaps.geocode.inc
original line 65: $base_url = 'http://maps.google.'. $settings['domain'] .'/maps/geo?output=json&oe=utf8&sensor=false&hl=en&key='. $key;
change to desired language: $base_url = 'http://maps.google.'. $settings['domain'] .'/maps/geo?output=json&oe=utf8&sensor=false&hl=cs&key='. $key;

Thanks for great module :-)

#11

Same problem here, but I can't use the evil_cz's hack because I have a multi-language site.

I'm happy with gmaps, except this minor problem.

Marco

#12

2 evil_cz:
I cannot understand why your solution does not work for me. My native language is Russian (hl=ru), but changing of $base_url takes no effect.
Any suggestions?

#13

I have the same problem. Its really a bad idea to enforce english for non-english language based sites.

#14

Status:active» needs review

hl=ru works fine for me and i think we can do small patch to put in request some var (from user Object or from smart_ip in $_SESSION array for setting it to language code by ip of the user) instead static (en)

gmaps.geocode.inc, line 38

<?php

$base_url
= 'http://maps.google.'. $settings['domain'] .'/maps/geo?output=json&oe=utf8&sensor=false&hl='.$_SESSION[smart_ip][location][country_code].'&key='. $key;
?>

after it language will be set upped to user's session ip country code from smart_ip

without smart_ip we can use $user->language; ;)

#15

Besides these settings there are still other problems:
Geonames provides country names in english, that are mixed with the localised location terms from Google inside the vocabulary. And multilingual sites will still have problems, because no language is assigned to the location terms retrieved from Google.