From: Fabrice Bellingard Date: Wed, 31 Aug 2011 10:28:15 +0000 (+0200) Subject: SONAR-2745 Fix wrong language display on the Components service page X-Git-Tag: 2.11^2~112 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=102ac2128ba72984cde518ecc873b2a2c07e296b;p=sonarqube.git SONAR-2745 Fix wrong language display on the Components service page --- diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index d8227b41094..02cec994c05 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -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 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb index e2a8d1ce08d..58d7b71408e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb @@ -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