]> git.openstreetmap.org Git - rails.git/commitdiff
Improve translatability of nominatim results. Closes #2498.
authorTom Hughes <tom@compton.nu>
Tue, 24 Nov 2009 13:53:39 +0000 (13:53 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 24 Nov 2009 13:53:39 +0000 (13:53 +0000)
22 files changed:
app/controllers/geocoder_controller.rb
config/locales/af.yml
config/locales/br.yml
config/locales/de.yml
config/locales/dsb.yml
config/locales/en.yml
config/locales/eo.yml
config/locales/es.yml
config/locales/fr.yml
config/locales/hr.yml
config/locales/hsb.yml
config/locales/hu.yml
config/locales/ia.yml
config/locales/is.yml
config/locales/mk.yml
config/locales/nds.yml
config/locales/nl.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/ru.yml
config/locales/te.yml
config/locales/vi.yml

index eed63c7a44fd5de3ab2ba1c9340ff6b0549bc921..9210fa8b5ebd31dee7f17b5aad09e0fa7ad2b068 100644 (file)
@@ -239,15 +239,10 @@ class GeocoderController < ApplicationController
       lat = place.attributes["lat"].to_s
       lon = place.attributes["lon"].to_s
       klass = place.attributes["class"].to_s
       lat = place.attributes["lat"].to_s
       lon = place.attributes["lon"].to_s
       klass = place.attributes["class"].to_s
-      type = place.attributes["type"].to_s.gsub("_", " ")
+      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(",")
       name = place.attributes["display_name"].to_s
       min_lat,max_lat,min_lon,max_lon = place.attributes["boundingbox"].to_s.split(",")
-
-      if klass == "highway" and ["trunk","primary","secondary","tertiary","unclassified","residential"].include?(type)
-        prefix = t 'geocoder.search_osm_nominatim.prefix_highway', :type => type.capitalize
-      else
-        prefix = t 'geocoder.search_osm_nominatim.prefix_other', :type => type.capitalize
-      end
+      prefix = t "geocoder.search_osm_nominatim.prefix_#{type}", :default => type.gsub("_", " ").capitalize
 
       @results.push({:lat => lat, :lon => lon,
                      :min_lat => min_lat, :max_lat => max_lat,
 
       @results.push({:lat => lat, :lon => lon,
                      :min_lat => min_lat, :max_lat => max_lat,
index 5962d865db86a47ef9b375a07dfeca2edb6e0fbc..3c8345ac55945ff325f305a3958cf15063fef519 100644 (file)
@@ -339,8 +339,6 @@ af:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} van {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} van {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} van {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} van {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Pad van tipe {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index d0f3e9c6324171ae2f25342ea58b0740f2162551..dfef8add3500fc93dd355fa030efb036a8d99b7c 100644 (file)
@@ -396,8 +396,6 @@ br:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} eus {{parentname}})"
       suffix_place: " {{distance}} {{direction}} diouzh {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} eus {{parentname}})"
       suffix_place: " {{distance}} {{direction}} diouzh {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: hent {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 3f412c57bfd1bcaf4f60f6d038d2bab3d284f90d..bed6e560b44519671bed46ee67948478725b723b 100644 (file)
@@ -407,8 +407,6 @@ de:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} von {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} von {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} von {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} von {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} Straße"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 5ed332809707ec17ce4a406a24f49f11a48c187d..52053c737a6c2cc46633632330385882381cbc1e 100644 (file)
@@ -406,8 +406,6 @@ dsb:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} wót {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} wót {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} wót {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} wót {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Droga typa {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index ebcc8a9a634757588f8e1dfd61a6a309fd718672..a6f70c685805666ca334ebbd6d9ba72c5d214616 100644 (file)
@@ -391,8 +391,19 @@ en:
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})"
       suffix_suburb: "{{suffix}}, {{parentname}}"
     search_osm_nominatim:
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})"
       suffix_suburb: "{{suffix}}, {{parentname}}"
     search_osm_nominatim:
-      prefix_highway: "{{type}} road"
-      prefix_other: "{{type}}"
+      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"
     description:
       title:
         osm_namefinder: '{{types}} from <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
     description:
       title:
         osm_namefinder: '{{types}} from <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
index 460cec79acadfd1c9911955387d5e07dba21a934..85f9ce810c72b25cfa905a7d2bc2c60421bfaebb 100644 (file)
@@ -328,8 +328,6 @@ eo:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} vojo"
   layouts: 
     donate: Subtenu OpenStreetMap {{link}} al Fonduso de Ĝisdatigo de Aparataro.
     donate_link_text: donacante
   layouts: 
     donate: Subtenu OpenStreetMap {{link}} al Fonduso de Ĝisdatigo de Aparataro.
     donate_link_text: donacante
index 12be554e977986dec44a4c56512ec7ebbfe1a89c..eacdcfbfd44bb4ac475f011e947c768c4aaed90e 100644 (file)
@@ -398,8 +398,6 @@ es:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: vía {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index ca74151420f66e335dfbaef736ae307d44151117..338490b1d09e4214051ef2d043f48de1197715ff 100644 (file)
@@ -402,8 +402,6 @@ fr:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: route {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 674f53cf7f9965fe8abd334a586bcc55badf7b80..4f0f100d920a1c891880660866d9638cb55340c1 100644 (file)
@@ -402,8 +402,6 @@ hr:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} od {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} od {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} od {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} od {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} cesta"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 30ca10da080847b4c9b13f05169110241a34b02d..858df1c07992069bc1f0ca35d04c55e9eeb3ee2e 100644 (file)
@@ -406,8 +406,6 @@ hsb:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} wot {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} z {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} wot {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} z {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Dróha typa {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index cef8f0ba1be5341b52c07e19a6f6fd64f2b9e9e2..51039096a8c006a0254b9adbb0fbbf4ee09c5c5f 100644 (file)
@@ -401,8 +401,6 @@ hu:
       suffix_parent: "{{suffix}} ({{parentdistance}}-re {{parentdirection}} innen: {{parentname}})"
       suffix_place: " {{distance}}-re {{direction}} innen: {{placename}}"
       suffix_suburb: "{{suffix}} ({{parentname}})"
       suffix_parent: "{{suffix}} ({{parentdistance}}-re {{parentdirection}} innen: {{parentname}})"
       suffix_place: " {{distance}}-re {{direction}} innen: {{placename}}"
       suffix_suburb: "{{suffix}} ({{parentname}})"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} út"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index d3a3c34b94620298419eece79b8e8319368d9cda..62dd731dbb375f38395013fbd0b68862964a4b53 100644 (file)
@@ -396,8 +396,6 @@ ia:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} al {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} al {{direction}} de {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} al {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} al {{direction}} de {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: cammino {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 8c4613e9102ae54fe839276bae3f49419ef3ceb8..310229526b07a8dcc51b2452e4b3a52c251260d6 100644 (file)
@@ -396,8 +396,6 @@ is:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} af {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} af {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} af {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} af {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} vegur"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index d4a97dfb129b3cc51f6af9065d4d0477218597d1..ffaa362dae9237f1d537509c29200a0a3d312353 100644 (file)
@@ -396,8 +396,6 @@ mk:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} од {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} од {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} од {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} од {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} пат"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 675afc035cf4f549bde6f530708ee5c4bf6ed2b6..e2cc0eab28008f9bcf1faf103457fda5920edd3a 100644 (file)
@@ -228,8 +228,6 @@ nds:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} von {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} von {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} von {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} von {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Straat von’n Typ {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index b37cba5c410c0d56ff44b388c25f46478e68da47..9c4caead83cdd916b028894b97ff9f1ad3b8c77f 100644 (file)
@@ -398,8 +398,6 @@ nl:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} van {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} van {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} van {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} van {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Weg van type {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index 450063c3c332c09f18acd86e787d79aaedf83e9c..7ad8e8859d790fb6915826d67c51d2286abb658a 100644 (file)
@@ -379,8 +379,6 @@ pl:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} względem {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} względem {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} względem {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} względem {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: droga {{type}}
   layouts: 
     donate: Wspomóż Projekt OpenStreetMap {{link}} na Konto Aktualizacji Naszego Sprzętu.
     donate_link_text: dokonując darowizny
   layouts: 
     donate: Wspomóż Projekt OpenStreetMap {{link}} na Konto Aktualizacji Naszego Sprzętu.
     donate_link_text: dokonując darowizny
index 272b4e393b34c1bdf59e28b59f9f547f741b7b43..c790723c34aa91e19f657de68092841b12f1b534 100644 (file)
@@ -395,9 +395,6 @@ pt-BR:
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
       suffix_suburb: "{{suffix}}, {{parentname}}"
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} de {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} de {{placename}}"
       suffix_suburb: "{{suffix}}, {{parentname}}"
-    search_osm_nominatim: 
-      prefix_highway: via {{type}}
-      prefix_other: "{{type}}"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index ceb0cf4221037d53b481029f92096ef9d044864c..a74729e1d02a8245efe427182387fbb2de9f283e 100644 (file)
@@ -398,8 +398,6 @@ ru:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} {{parentname}})"
       suffix_place: ", {{distance}} {{direction}} {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} дорога"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index e96909453dc1499218a2a51c21808daca1fbfb21..d0a52007130732ac9a345ef1f53e80f985487ad4 100644 (file)
@@ -153,8 +153,6 @@ te:
         ca_postcode: <a href="http://geocoder.ca/">Geocoder.CA</a> నుండి ఫలితాలు
         geonames: <a href="http://www.geonames.org/">GeoNames</a> నుండి ఫలితాలు
         us_postcode: <a href="http://geocoder.us/">Geocoder.us</a> నుండి ఫలితాలు
         ca_postcode: <a href="http://geocoder.ca/">Geocoder.CA</a> నుండి ఫలితాలు
         geonames: <a href="http://www.geonames.org/">GeoNames</a> నుండి ఫలితాలు
         us_postcode: <a href="http://geocoder.us/">Geocoder.us</a> నుండి ఫలితాలు
-    search_osm_nominatim: 
-      prefix_highway: "{{type}} రహదారి"
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: 
index d27906f12ab5c4b1156a40a660ee62c4b78a376d..fe09892780307d49c72ea42c42c2d3692d819f8a 100644 (file)
@@ -394,8 +394,6 @@ vi:
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} về phía {{parentdirection}} của {{parentname}})"
       suffix_place: ", {{distance}} về phía {{direction}} của {{placename}}"
     search_osm_namefinder: 
       suffix_parent: "{{suffix}} ({{parentdistance}} về phía {{parentdirection}} của {{parentname}})"
       suffix_place: ", {{distance}} về phía {{direction}} của {{placename}}"
-    search_osm_nominatim: 
-      prefix_highway: Đường {{type}}
   javascripts: 
     map: 
       base: 
   javascripts: 
     map: 
       base: