From 62e9b0a912ca8bf8ad0bf8d82525fe92a27fb890 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 19 Jul 2011 11:49:23 +0200 Subject: [PATCH] SONAR-2589 Modification of all web ruby templates to use bundles - Add I18n to dashboard page - Add I18n to dashboards management --- .../resources/org/sonar/i18n/core.properties | 35 +++++++++++++++++++ .../WEB-INF/app/helpers/application_helper.rb | 12 +++---- .../dashboard/_configure_widget.html.erb | 8 ++--- .../app/views/dashboard/_header.html.erb | 10 +++--- .../app/views/dashboard/_widget.html.erb | 4 +-- .../dashboard/_widget_definition.html.erb | 2 +- .../dashboard/_widget_definitions.html.erb | 4 +-- .../dashboard/_widget_properties.html.erb | 4 +-- .../app/views/dashboard/edit_layout.html.erb | 2 +- .../app/views/dashboards/_create.html.erb | 10 +++--- .../app/views/dashboards/_edit.html.erb | 12 +++---- .../app/views/dashboards/index.html.erb | 32 ++++++++--------- 12 files changed, 85 insertions(+), 50 deletions(-) diff --git a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties index 20ba42c04a4..c2dc33a7b49 100644 --- a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties +++ b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties @@ -49,12 +49,15 @@ date=Date days=Days delete=Delete descending=Descending +description=Description directory=Directory directories=Directories display=Display edit=Edit file=File files=Files +filter_verb=Filter +follow=Follow identifier_abbreviated=Id info=Info key=Key @@ -94,6 +97,7 @@ rule=Rule review=Review reviews=Reviews review_verb=Review +save=Save search_verb=Search select_verb=Select severity=Severity @@ -162,7 +166,9 @@ move_left=Move left move_right=Move right new_violations=New violations new_window=New window +no_data=No data no_results=No results +over_x_days=over {0} days page_size=Page size project_name=Project name remove_column=Remove this column @@ -171,6 +177,12 @@ save_and_close=Save & Close save_and_preview=Save & Preview select_a_metric=Select a metric set_as_default=Set as default +shared_by=Shared by +since_x=since {0} +since_previous_analysis=since previous analysis +since_previous_analysis_detailed=since previous analysis ({0}) +since_version=since version {0} +since_version_detailed=since version {0} ({1}) time_changes=Time changes update_comment=Update comment @@ -279,6 +291,29 @@ filters.shared_filters=Shared filters filters.shared_filters_description=These filters are shared by administrators and can be followed without copying them. +#------------------------------------------------------------------------------ +# +# DASHBOARD / DASHBOARDS +# +#------------------------------------------------------------------------------ + +dashboard.click_to_choose_layout=Click to choose the layout +dashboard.cannot_render_widget_x=Can not render widget {0}: {1} +dashboard.back_to_dashboard=Back to dashboard +dashboard.configure_widgets=Configure widgets +dashboard.edit_layout=Edit layout +dashboard.manage_dashboards=Manage dashboards +dashboard.add_widget=Add widget +dashboard.please_configure_the_widget_x=Please configure the widget {0}. +dashboard.my_dashboards=My dashboards +dashboard.no_dashboard=No dashboard +dashboard.do_you_want_to_delete_dashboard=Do you want to delete this dashboard ? +dashboard.shared_dashboards=Shared dashboards +dashboard.create_dashboard=Create dashboard +dashboard.edit_dashboard=Edit dashboard +dashboard.update_dashboard=Update dashboard + + #------------------------------------------------------------------------------ # # COMPONENTS diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index 32644cb14e7..1b839e29a84 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -93,21 +93,21 @@ module ApplicationHelper label=nil if mode if mode=='days' - label = "over %s days" % mode_param + label = message('over_x_days', :params => mode_param.to_s) elsif mode=='version' if date - label = "since version %s (%s)" % [mode_param, date.strftime("%Y %b %d")] + label = message('since_version_detailed', :params => [mode_param.to_s, date.strftime("%Y %b %d").to_s]) else - label = "since version %s" % mode_param + label = message('since_version', :params => mode_param.to_s) end elsif mode=='previous_analysis' if !date.nil? - label = "since previous analysis (%s)" % (date.strftime("%Y %b %d")) + label = message('since_previous_analysis_detailed', :params => date.strftime("%Y %b %d").to_s) else - label = "since previous analysis" + label = message('since_previous_analysis') end elsif mode=='date' - label = "since #{date.strftime("%Y %b %d")}" + label = message('since_x', :params => date.strftime("%Y %b %d").to_s) end end label diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb index 10e27fa1ac8..08096680906 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb @@ -2,16 +2,16 @@ begin widget_body=render :inline => definition.getTarget().getTemplate(), :locals => {:widget_properties => widget.properties_as_hash, :widget => widget, :dashboard_configuration => @dashboard_configuration} rescue => error - logger.error("Can not render widget #{definition.getId()}: " + error) + logger.error(message('dashboard.cannot_render_widget_x', :params => [definition.getId(), error])) logger.error(error.backtrace.join("\n")) widget_body="" end %>
- Delete + <%= message('delete') -%> <% if definition.isEditable() %> - Edit + <%= message('edit') -%> <% end %> <%= definition.getTitle() -%>
@@ -41,7 +41,7 @@ <%= widget_body -%> <% if default_layout %>
<% end %> <% else %> -

No data

+

<%= message('no_data') -%>

<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb index b03580a90fd..579f164064f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb @@ -2,13 +2,13 @@ <% if logged_in? %> <% end %> @@ -22,7 +22,7 @@
+
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb index 3a34c98cb6d..7713ecf70e2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb @@ -1,7 +1,7 @@