Posted by mongolito404 on July 14, 2009 at 1:39pm
Jump to:
| Project: | Location |
| Version: | 6.x-3.1 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
| Issue tags: | location translation |
Issue Summary
Currently, the location module use language independent provinces names. For instance, the name for the Belgian province with code WBR will always be ""Brabant Wallon", regardless of the language set for the site or by the user. But this is its French name and it has a different name in English ("Walloon Brabant") and in Dutch ("Waals-Brabant").
A solution may be to cache province names by language in location_get_provinces and to return translated names in location_province_list_$country (see attached patch).
| Attachment | Size |
|---|---|
| location.patch | 2.59 KB |
Comments
#1
#2
tagging.
#3
Subscribing, will this patch be getting in?
Thanks a lot in advance for considering.
Greetings, Martijn
#4
+1 for patch concept
A Russian user is going to be looking for Москва, not Moscow (City). The original patch is missing
return $provinces[$langcode][$country];
in the 'location_province_list_'. $country function call.
#5
subscribe
#6
I tried applying this patch for an equivalent (Canadian) problem. The first hunk was applied (no problem), then I adapted the location.ca.inc file to wrap province names in t(). Then I re-loaded the language.inc file via the UI. Once this is done, what's actually supposed to happen? I'm not sure if I'm dealing with a failed patch or with caching issues...but I'm not seeing new strings to translate?
#7
Aha! I think I needed to refresh my translations at admin/build/translate/refresh. I now see Provinces listed as taxonomy terms...is that what you were expecting?
#8
I'm using this patch on 3.1 and it works well. I made similar changes to location.ca.inc for Canadian province names. I did have to manually truncate the table cache_location in the database to get my changes to show up, however.
My remaining problem is that when using the views sort "location: provinces" the order is always according to the English (untranslated) names.
I'll attach a further patch for that when I can.I thought I could I write a handler for that which uses the province name instead of the abbreviation but in fact views sorts require a field that is stored in the database meaning that data from the supported/ directory would be tricky to handle. I think this would require another cache table someplace to allow writing an ORDER BY clause to catch this but that would be a major change in addition to a big mess so I'm not touching it until province and country names are stored in the db (if that ever happens). So it's an ugly template hack for me :(#9
forgot to change status
#10
This patch also works for me although I had to modify the location.ca.inc -- can we deploy this for all countries it would be pretty awesome!
Also, has anyone run into an issue with city names not being translated. I'm scratching my head trying to figure out how to resolve that.