diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-19 18:51:28 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-19 18:51:28 +0200 |
commit | 7498e17be42112648345e20825ad84e6760b849b (patch) | |
tree | 747baf0f86ea3bf032d9874165f9bc3e7b75dd79 /sonar-server | |
parent | 543aee63f3f5fa52cd34be4565085ce895b9e8bf (diff) | |
download | sonarqube-7498e17be42112648345e20825ad84e6760b849b.tar.gz sonarqube-7498e17be42112648345e20825ad84e6760b849b.zip |
SONAR-2589 Modification of all web ruby templates to use bundles
- Add I18n to widgets
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb | 8 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb index 422e45cbf55..d5079f420c4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb @@ -41,6 +41,14 @@ class ProjectLink < ActiveRecord::Base link_type end + def name(translate=true) + default_string = read_attribute(:name) + return default_string unless translate + + i18n_key = 'project_links.' + read_attribute(:link_type) + Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, i18n_key, default_string, [].to_java) + end + def self.name_to_key(s) s.tr(' ', '_')[0..19] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb index 5bacdff2934..345f89f10d5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb @@ -1,7 +1,7 @@ <td> <div class="widget_def" id="def_<%= definition.getId().tr('_', '') -%>"> -<p><b><%= h definition.getTitle() -%></b></p> -<p><%= h definition.getDescription() -%></p> +<p><b><%= h message('widget.' + definition.getId() + '.title') -%></b></p> +<p><%= h message('widget.' + definition.getId() + '.description') -%></p> <%= form_tag :action => 'add_widget', :did => dashboard_id, :id => resource_id, :widget => definition.getId() %> <input type="submit" value="<%= message('dashboard.add_widget') -%>" > </form> |