X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/427f896cdfcab441519e88afa41395ec2a06621a..f6c7ed601159aca360da09948f1544172ddf1a41:/app/controllers/geocoder_controller.rb?ds=sidebyside diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 47befda38..8f02ce51d 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -174,6 +174,10 @@ class GeocoderController < ApplicationController name = place.attributes["display_name"].to_s min_lat,max_lat,min_lon,max_lon = place.attributes["boundingbox"].to_s.split(",") prefix_name = t "geocoder.search_osm_nominatim.prefix.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize + if klass == 'boundary' and type == 'administrative' + rank = (place.attributes["place_rank"].to_i + 1) / 2 + prefix_name = t "geocoder.search_osm_nominatim.admin_levels.level#{rank}", :default => prefix_name + end prefix = t "geocoder.search_osm_nominatim.prefix_format", :name => prefix_name object_type = place.attributes["osm_type"] object_id = place.attributes["osm_id"]