From 0fd4a6175961671f25f70e055c28aaabc66685a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 16 May 2010 15:54:11 +0000 Subject: [PATCH] Allow for formatting of the nominatim prefix in the i18n system It's a pain to translate nominatim as-is because the context forces me to translate things in the accusative case. Now I can change "{{name}}" into "{{name}}:" and translate things in the nominative case. Not putting the message in search_osm_nominatim so I don't infringe upon its namespace. --- app/controllers/geocoder_controller.rb | 3 ++- config/locales/en.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index aaa8d17ef..2071dacce 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -253,7 +253,8 @@ 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.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize + prefix_name = t "geocoder.search_osm_nominatim.prefix.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize + prefix = t "geocoder.search_osm_nominatim_format.prefix", :name => prefix_name @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 9bdfe0e3c..c6043fa32 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -413,6 +413,8 @@ en: suffix_place: ", {{distance}} {{direction}} of {{placename}}" suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})" suffix_suburb: "{{suffix}}, {{parentname}}" + search_osm_nominatim_format: + prefix: "{{name}}" search_osm_nominatim: prefix: amenity: -- 2.39.5