From e83b793437184341c9a6fef2a1c6735c42fe1c30 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 24 Nov 2009 13:53:39 +0000 Subject: [PATCH] Improve translatability of nominatim results. Closes #2498. --- app/controllers/geocoder_controller.rb | 9 ++------- config/locales/af.yml | 2 -- config/locales/br.yml | 2 -- config/locales/de.yml | 2 -- config/locales/dsb.yml | 2 -- config/locales/en.yml | 15 +++++++++++++-- config/locales/eo.yml | 2 -- config/locales/es.yml | 2 -- config/locales/fr.yml | 2 -- config/locales/hr.yml | 2 -- config/locales/hsb.yml | 2 -- config/locales/hu.yml | 2 -- config/locales/ia.yml | 2 -- config/locales/is.yml | 2 -- config/locales/mk.yml | 2 -- config/locales/nds.yml | 2 -- config/locales/nl.yml | 2 -- config/locales/pl.yml | 2 -- config/locales/pt-BR.yml | 3 --- config/locales/ru.yml | 2 -- config/locales/te.yml | 2 -- config/locales/vi.yml | 2 -- 22 files changed, 15 insertions(+), 50 deletions(-) diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index eed63c7a4..9210fa8b5 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -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 - 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(",") - - 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, diff --git a/config/locales/af.yml b/config/locales/af.yml index 5962d865d..3c8345ac5 100644 --- a/config/locales/af.yml +++ b/config/locales/af.yml @@ -339,8 +339,6 @@ af: 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: diff --git a/config/locales/br.yml b/config/locales/br.yml index d0f3e9c63..dfef8add3 100644 --- a/config/locales/br.yml +++ b/config/locales/br.yml @@ -396,8 +396,6 @@ br: 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: diff --git a/config/locales/de.yml b/config/locales/de.yml index 3f412c57b..bed6e560b 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -407,8 +407,6 @@ de: 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: diff --git a/config/locales/dsb.yml b/config/locales/dsb.yml index 5ed332809..52053c737 100644 --- a/config/locales/dsb.yml +++ b/config/locales/dsb.yml @@ -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_nominatim: - prefix_highway: Droga typa {{type}} javascripts: map: base: diff --git a/config/locales/en.yml b/config/locales/en.yml index ebcc8a9a6..a6f70c685 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -391,8 +391,19 @@ en: 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 OpenStreetMap Namefinder' diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 460cec79a..85f9ce810 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -328,8 +328,6 @@ eo: 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 diff --git a/config/locales/es.yml b/config/locales/es.yml index 12be554e9..eacdcfbfd 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -398,8 +398,6 @@ es: 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: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ca7415142..338490b1d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -402,8 +402,6 @@ fr: 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: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 674f53cf7..4f0f100d9 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -402,8 +402,6 @@ hr: 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: diff --git a/config/locales/hsb.yml b/config/locales/hsb.yml index 30ca10da0..858df1c07 100644 --- a/config/locales/hsb.yml +++ b/config/locales/hsb.yml @@ -406,8 +406,6 @@ hsb: 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: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index cef8f0ba1..51039096a 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -401,8 +401,6 @@ hu: 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: diff --git a/config/locales/ia.yml b/config/locales/ia.yml index d3a3c34b9..62dd731db 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -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_nominatim: - prefix_highway: cammino {{type}} javascripts: map: base: diff --git a/config/locales/is.yml b/config/locales/is.yml index 8c4613e91..310229526 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -396,8 +396,6 @@ is: 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: diff --git a/config/locales/mk.yml b/config/locales/mk.yml index d4a97dfb1..ffaa362da 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -396,8 +396,6 @@ mk: search_osm_namefinder: suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} од {{parentname}})" suffix_place: ", {{distance}} {{direction}} од {{placename}}" - search_osm_nominatim: - prefix_highway: "{{type}} пат" javascripts: map: base: diff --git a/config/locales/nds.yml b/config/locales/nds.yml index 675afc035..e2cc0eab2 100644 --- a/config/locales/nds.yml +++ b/config/locales/nds.yml @@ -228,8 +228,6 @@ nds: 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: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index b37cba5c4..9c4caead8 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -398,8 +398,6 @@ nl: 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: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 450063c3c..7ad8e8859 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -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_nominatim: - prefix_highway: droga {{type}} layouts: donate: Wspomóż Projekt OpenStreetMap {{link}} na Konto Aktualizacji Naszego Sprzętu. donate_link_text: dokonując darowizny diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 272b4e393..c790723c3 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -395,9 +395,6 @@ pt-BR: 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: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ceb0cf422..a74729e1d 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -398,8 +398,6 @@ ru: search_osm_namefinder: suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} {{parentname}})" suffix_place: ", {{distance}} {{direction}} {{placename}}" - search_osm_nominatim: - prefix_highway: "{{type}} дорога" javascripts: map: base: diff --git a/config/locales/te.yml b/config/locales/te.yml index e96909453..d0a520071 100644 --- a/config/locales/te.yml +++ b/config/locales/te.yml @@ -153,8 +153,6 @@ te: ca_postcode: Geocoder.CA నుండి ఫలితాలు geonames: GeoNames నుండి ఫలితాలు us_postcode: Geocoder.us నుండి ఫలితాలు - search_osm_nominatim: - prefix_highway: "{{type}} రహదారి" javascripts: map: base: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index d27906f12..fe0989278 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -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_nominatim: - prefix_highway: Đường {{type}} javascripts: map: base: -- 2.39.5