]> git.openstreetmap.org Git - rails.git/commitdiff
Don't remove language prefixes from wikipedia tags
authorPaweł Paprota <ppawel@fastmail.fm>
Fri, 5 Oct 2012 18:23:40 +0000 (20:23 +0200)
committerTom Hughes <tom@compton.nu>
Sun, 7 Oct 2012 15:01:50 +0000 (16:01 +0100)
Removing the language prefix from the displayed value of a wikipedia
tag is confusing, so don't do it. Fixes trac #4135.

app/helpers/browse_helper.rb

index ffc638cdf491a6c7a22d57f420568f0ed173faa7..ea17b8202d1a9a4ac7b9493c8deb234aa00a34b7 100644 (file)
@@ -14,7 +14,7 @@ module BrowseHelper
       name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
     end
 
-    # don't look at object tags if redacted, so as to avoid giving 
+    # don't look at object tags if redacted, so as to avoid giving
     # away redacted version tag information.
     unless object.redacted?
       if object.tags.include? "name:#{I18n.locale}"
@@ -63,7 +63,7 @@ module BrowseHelper
 
 private
 
-  ICON_TAGS = [ 
+  ICON_TAGS = [
     "aeroway", "amenity", "barrier", "building", "highway", "historic", "landuse",
     "leisure", "man_made", "natural", "railway", "shop", "tourism", "waterway"
   ]
@@ -99,8 +99,8 @@ private
       # from de to zh-classical
       if value =~ /^([a-z-]{2,12}):(.+)$/
         # Value is <lang>:<title> so split it up
+        # Note that value is always left as-is, see: https://trac.openstreetmap.org/ticket/4315
         lang  = $1
-        value = $2
       else
         # Value is <title> so default to English Wikipedia
         lang = 'en'