]> git.openstreetmap.org Git - rails.git/commitdiff
Allow for formatting of the nominatim prefix in the i18n system
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 16 May 2010 15:54:11 +0000 (15:54 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 17 May 2010 23:06:43 +0000 (00:06 +0100)
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
config/locales/en.yml

index aaa8d17ef114524cff62490b5db150279dee5d6c..2071daccebeddcd494d63a44d28f43993a2b5b89 100644 (file)
@@ -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,
index 9bdfe0e3c329339181f0f1fb4f43e2ca7477e443..c6043fa328ba68865e32964fe81791c02e91e4c0 100644 (file)
@@ -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: