From: Tom Hughes Date: Tue, 24 Nov 2009 14:02:08 +0000 (+0000) Subject: Refactor nominatim translation a bit more. X-Git-Tag: live~6446 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ef2cca8bd0b736cc9bbd11c0e1b31c77fed6a1c4 Refactor nominatim translation a bit more. --- diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 9210fa8b5..85e056a55 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -242,7 +242,7 @@ class GeocoderController < ApplicationController type = place.attributes["type"].to_s name = place.attributes["display_name"].to_s min_lat,max_lat,min_lon,max_lon = place.attributes["boundingbox"].to_s.split(",") - prefix = t "geocoder.search_osm_nominatim.prefix_#{type}", :default => type.gsub("_", " ").capitalize + prefix = t "geocoder.search_osm_nominatim.prefix.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize @results.push({:lat => lat, :lon => lon, :min_lat => min_lat, :max_lat => max_lat, diff --git a/config/locales/en.yml b/config/locales/en.yml index 122977346..a053a7793 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -391,21 +391,30 @@ en: suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})" suffix_suburb: "{{suffix}}, {{parentname}}" search_osm_nominatim: - prefix_motorway: "Motorway" - prefix_trunk: "Trunk road" - prefix_primary: "Primary road" - prefix_secondary: "Secondary road" - prefix_tertiary: "Tertiary road" - prefix_unclassified: "Unclassified road" - prefix_residential: "Residential road" - prefix_city: "City" - prefix_town: "Town" - prefix_suburb: "Suburb" - prefix_village: "Village" - prefix_hamlet: "Hamlet" - prefix_station: "Station" - prefix_bus_stop: "Bus stop" - prefix_pub: "Pub" + prefix + highway: + motorway: "Motorway" + trunk: "Trunk road" + primary: "Primary road" + secondary: "Secondary road" + tertiary: "Tertiary road" + unclassified: "Unclassified road" + residential: "Residential road" + track: "Track" + footway: "Footpath" + cycleway: "Cycle path" + bridleway: "Bridleway" + place: + city: "City" + town: "Town" + suburb: "Suburb" + village: "Village" + hamlet: "Hamlet" + railway: + station: "Station" + amenity: + bus_stop: "Bus stop" + pub: "Pub" description: title: osm_namefinder: '{{types}} from OpenStreetMap Namefinder'