Needs review
Project:
Google Maps Tools
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2008 at 22:21 UTC
Updated:
22 Dec 2010 at 14:58 UTC
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
Comment #1
Tarsjusz commentedI'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!
Comment #2
xmarket commentedWhat do you mean "search results"? Is it a view field or dou you mean the search snippets of fields?
Comment #3
Tarsjusz commentedIn 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!
Comment #4
xmarket commentedDid you translate the texts at admin >> build >> translate interface (admin/build/translate)?
Comment #5
Tarsjusz commentedThanks, 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.
Comment #6
xmarket commentedComment #7
thommyboy commentedi 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."
Comment #8
xmarket commentedFirst, 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).
Comment #9
thommyboy commentedhi 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!
Comment #10
evil_cz commentedreopen - 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 :-)
Comment #11
m.sant commentedSame 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
Comment #12
kinosura commented2 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?
Comment #13
tribsel commentedI have the same problem. Its really a bad idea to enforce english for non-english language based sites.
Comment #14
ionmedia commentedhl=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
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; ;)
Comment #15
digi24 commentedBesides 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.