]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2745 Fix wrong language display on the Components service page
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 10:28:15 +0000 (12:28 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 10:28:15 +0000 (12:28 +0200)
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb

index d8227b41094f36b94f2541e21a94888f17552cd8..02cec994c055549fc27ea4505182064fbbe5db02 100644 (file)
@@ -21,6 +21,7 @@ backup_verb=Backup
 blocker=Blocker
 bold=Bold
 build_date=Build date
+build_time=Build time
 cancel=Cancel
 category=Category
 calendar=Calendar
index e2a8d1ce08dc4c6d3a599de530cd4b6d390ea2c0..58d7b71408e4e284bfd3011f136c55734a6d554e 100644 (file)
@@ -30,6 +30,20 @@ class Sonar::ColumnsView
 
   attr_accessor :id, :name, :col_type, :position, :sort_default
 
+  def name(translate=true)
+    default_string = @name
+    return default_string unless translate
+    
+    i18n_key = @id
+    return nil if i18n_key.nil?
+    
+    if metric_column?
+      i18n_key = 'metric.' + i18n_key + '.name'
+    end
+    
+    Api::Utils.message(i18n_key, :default => default_string)
+  end
+  
   def project_column?
     @col_type == TYPE_PROJECT
   end