aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-07-19 11:49:23 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-07-19 12:33:39 +0200
commit62e9b0a912ca8bf8ad0bf8d82525fe92a27fb890 (patch)
tree2cfd3e44dcc8287472dd5667980d6fb38aa79904 /sonar-server/src/main
parent901437b374d017df765ae190f7335fdeb185c15e (diff)
downloadsonarqube-62e9b0a912ca8bf8ad0bf8d82525fe92a27fb890.tar.gz
sonarqube-62e9b0a912ca8bf8ad0bf8d82525fe92a27fb890.zip
SONAR-2589 Modification of all web ruby templates to use bundles
- Add I18n to dashboard page - Add I18n to dashboards management
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definitions.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit.html.erb12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb32
11 files changed, 50 insertions, 50 deletions
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
%>
<div class="handle" style="//overflow:hidden;//zoom:1;">
- <a class="block-remove" onclick="portal.deleteWidget(this);return false;">Delete</a>
+ <a class="block-remove" onclick="portal.deleteWidget(this);return false;"><%= message('delete') -%></a>
<% if definition.isEditable() %>
- <a class="block-view-toggle" onclick="portal.editWidget(<%= widget.id -%>);return false;">Edit</a>
+ <a class="block-view-toggle" onclick="portal.editWidget(<%= widget.id -%>);return false;"><%= message('edit') -%></a>
<% end %>
<%= definition.getTitle() -%>
</div>
@@ -41,7 +41,7 @@
<%= widget_body -%>
<% if default_layout %><div class="clear"> </div></div><% end %>
<% else %>
- <div class="widget"><p>No data</p></div>
+ <div class="widget"><p><%= message('no_data') -%></p></div>
<% end %>
<div style="clear: both;"></div>
</div>
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? %>
<ul class="operations">
<% if back %>
- <li class="last"><%= link_to 'Back to dashboard', {:action => 'index', :did => @dashboard.id, :id => @resource.id } -%></li>
+ <li class="last"><%= link_to message('dashboard.back_to_dashboard'), {:action => 'index', :did => @dashboard.id, :id => @resource.id } -%></li>
<% else %>
<% if @dashboard.editable_by?(current_user) %>
- <li><%= link_to 'Configure widgets', {:action => 'configure', :did => @dashboard.id, :id => @resource.id } -%></li>
- <li><%= link_to 'Edit layout', {:action => 'edit_layout', :did => @dashboard.id, :id => @resource.id } -%></li>
+ <li><%= link_to message('dashboard.configure_widgets'), {:action => 'configure', :did => @dashboard.id, :id => @resource.id } -%></li>
+ <li><%= link_to message('dashboard.edit_layout'), {:action => 'edit_layout', :did => @dashboard.id, :id => @resource.id } -%></li>
<% end %>
- <li class="last"><%= link_to 'Manage dashboards', {:controller => 'dashboards', :action => 'index', :resource => @resource.id } -%></li>
+ <li class="last"><%= link_to message('dashboard.manage_dashboards'), {:controller => 'dashboards', :action => 'index', :resource => @resource.id } -%></li>
<% end %>
</ul>
<% end %>
@@ -22,7 +22,7 @@
<form method="GET" action="<%= url_for :controller => 'dashboard', :action => 'index', :id => @resource.id -%>" style="display: inline">
<input type="hidden" name="did" value="<%= @dashboard.id -%>" />
<select id="select-comparison" name="period" onchange="submit()" class="small">
- <option value="">Time changes...</option>
+ <option value=""><%= message('time_changes') -%>...</option>
<%= period_select_options(@snapshot, 1) -%>
<%= period_select_options(@snapshot, 2) -%>
<%= period_select_options(@snapshot, 3) -%>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
index d9b61337aa0..54265983a6f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
@@ -4,7 +4,7 @@
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
@@ -24,7 +24,7 @@
%>
<% else %>
<div class="widget">
- <p>Please <a href="<%= url_for :action => :configure, :did => @dashboard.id, :id => @resource.id -%>">configure</a> the widget <b><%= definition.getTitle() -%></b>.</p>
+ <p><a href="<%= url_for :action => :configure, :did => @dashboard.id, :id => @resource.id -%>"><%= message('dashboard.please_configure_the_widget_x', :params => definition.getTitle()) -%></a></p>
</div>
<% end %>
<div style="clear: both;"></div>
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 eaaceb181c2..5bacdff2934 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
@@ -3,7 +3,7 @@
<p><b><%= h definition.getTitle() -%></b></p>
<p><%= h definition.getDescription() -%></p>
<%= form_tag :action => 'add_widget', :did => dashboard_id, :id => resource_id, :widget => definition.getId() %>
-<input type="submit" value="Add widget" >
+<input type="submit" value="<%= message('dashboard.add_widget') -%>" >
</form>
</div>
</td>
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 @@
<p>
<ul class="horizontal widget_categs">
- <li>Filter: </li>
- <li class="<%= 'selected' if filter_on_category.blank? -%>"><a href="#" onClick="return filterWidgets('')">None</a></li>
+ <li><%= message('filter_verb') -%>: </li>
+ <li class="<%= 'selected' if filter_on_category.blank? -%>"><a href="#" onClick="return filterWidgets('')"><%= message('none') -%></a></li>
<% @widget_categories.each do |category| %>
<li class="<%= 'selected' if filter_on_category==category -%>"><a href="#" onClick="return filterWidgets('<%= category -%>')"><%= h(category) -%></a></li>
<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb
index a1a5d8ae52a..5e61afa5646 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb
@@ -21,9 +21,9 @@
<% end %>
<tr>
<td colspan="2">
- <%= submit_tag 'Save' %>
+ <%= submit_tag message('save') %>
<% if widget.configured %>
- <a href="#" onClick="portal.cancelEditWidget(<%= widget.id -%>);return false;">Cancel</a>
+ <a href="#" onClick="portal.cancelEditWidget(<%= widget.id -%>);return false;"><%= message('cancel') -%></a>
<% end %>
</td>
</tr>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
index 02ec1c72596..30c241fe82c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
@@ -2,7 +2,7 @@
<%= render :partial => 'dashboard/header', :locals => {:back => true} %>
<div id="edit-layout" class="admin">
- <p class="note">Click to choose the layout: </p><br/>
+ <p class="note"><%= message('dashboard.click_to_choose_layout') -%>: </p><br/>
<div class="select-layout <%= 'selected' if @dashboard.layout=='100%' -%>" style="text-align:center;width: 20%;">
<%= link_to image_tag('layout100.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "100%"}, :method => :post %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create.html.erb
index 72f6133a23f..f5aef418880 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create.html.erb
@@ -3,28 +3,28 @@
<form action="<%= url_for :action => 'create', :resource => params[:resource] -%>" id="create-dashboard-form" method="POST">
<tbody>
<tr>
- <td colspan="2"><h1>Create dashboard</h1></td>
+ <td colspan="2"><h1><%= message('dashboard.create_dashboard') -%></h1></td>
</tr>
<tr>
<td class="left" valign="top">
- Name:<br/><input type="text" name="name" size="30" maxlength="256"></input>
+ <%= message('name') -%>:<br/><input type="text" name="name" size="30" maxlength="256"></input>
</td>
</tr>
<tr>
<td class="left" valign="top">
- Description:<br/><input type="text" name="description" size="30" maxlength="1000"></input>
+ <%= message('description') -%>:<br/><input type="text" name="description" size="30" maxlength="1000"></input>
</td>
</tr>
<% if is_admin? %>
<tr>
<td class="left" valign="top">
- Shared:<br/><input type="checkbox" name="shared" value="true"></input>
+ <%= message('shared') -%>:<br/><input type="checkbox" name="shared" value="true"></input>
</td>
</tr>
<% end %>
<tr>
<td class="left" valign="top">
- <input type="submit" value="Create dashboard"/>
+ <input type="submit" value="<%= message('dashboard.create_dashboard') -%>"/>
</td>
</tr>
</tbody>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit.html.erb
index 14b734c41b7..400a4df767c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit.html.erb
@@ -2,29 +2,29 @@
<table class="admintable" width="100%">
<tbody>
<tr>
- <td colspan="2"><h1>Edit dashboard</h1></td>
+ <td colspan="2"><h1><%= message('dashboard.edit_dashboard') -%></h1></td>
</tr>
<tr>
<td class="left" valign="top">
- Name:<br/><input type="text" name="name" size="30" maxlength="256" value="<%= @dashboard.name -%>"></input>
+ <%= message('name') -%>:<br/><input type="text" name="name" size="30" maxlength="256" value="<%= @dashboard.name -%>"></input>
</td>
</tr>
<tr>
<td class="left" valign="top">
- Description:<br/><input type="text" name="description" size="30" maxlength="1000" value="<%= @dashboard.description -%>"></input>
+ <%= message('description') -%>:<br/><input type="text" name="description" size="30" maxlength="1000" value="<%= @dashboard.description -%>"></input>
</td>
</tr>
<% if is_admin? %>
<tr>
<td class="left" valign="top">
- Shared:<br/><input type="checkbox" name="shared" value="true" <%= 'checked' if @dashboard.shared -%>></input>
+ <%= message('shared') -%>:<br/><input type="checkbox" name="shared" value="true" <%= 'checked' if @dashboard.shared -%>></input>
</td>
</tr>
<% end %>
<tr>
<td class="left" valign="top">
- <input type="submit" value="Update dashboard"/>
- <a href="<%= url_for :action => 'index', :resource => params[:resource] -%>">Cancel</a>
+ <input type="submit" value="<%= message('dashboard.update_dashboard') -%>"/>
+ <a href="<%= url_for :action => 'index', :resource => params[:resource] -%>"><%= message('cancel') -%></a>
</td>
</tr>
</tbody>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
index d6a1a26b7af..965cb7045dc 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
@@ -3,19 +3,19 @@
<tr>
<td valign="top">
- <h1 class="marginbottom10">My dashboards</h1>
+ <h1 class="marginbottom10"><%= message('dashboard.my_dashboards') -%></h1>
<table class="data marginbottom10" id="dashboards">
<thead>
<tr>
- <th>Name</th>
- <% if is_admin %><th>Shared</th><% end %>
- <th>Order</th>
- <th>Operations</th>
+ <th><%= message('name') -%></th>
+ <% if is_admin %><th><%= message('shared') -%></th><% end %>
+ <th><%= message('order') -%></th>
+ <th><%= message('operations') -%></th>
</tr>
</thead>
<tbody>
<% if @actives.nil? || @actives.empty? %>
- <tr class="even"><td colspan="5">No dashboards</td></tr>
+ <tr class="even"><td colspan="5"><%= message('dashboard.no_dashboard') -%></td></tr>
<%
else
@actives.each_with_index do |active,index| %>
@@ -43,13 +43,13 @@
</td>
<td>
<% if active.owner?(current_user) %>
- <%= link_to 'Configure widgets', {:controller => :dashboard, :action => 'configure', :did => active.dashboard_id, :id => params[:resource]}, :id => "configure-#{u active.name}" %>
+ <%= link_to message('dashboard.configure_widgets'), {:controller => :dashboard, :action => 'configure', :did => active.dashboard_id, :id => params[:resource]}, :id => "configure-#{u active.name}" %>
|
- <%= link_to_remote "Edit", :update => "admin_form", :url => { :action => "edit", :id => active.dashboard_id, :resource => params[:resource] }, :id => "edit-#{u active.name}", :method => :get %>
+ <%= link_to_remote message('edit'), :update => "admin_form", :url => { :action => "edit", :id => active.dashboard_id, :resource => params[:resource] }, :id => "edit-#{u active.name}", :method => :get %>
|
- <%= link_to 'Delete', {:action => 'delete', :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :confirm => 'Do you want to delete this dashboard ?', :id => "delete-#{u active.name}" %>
+ <%= link_to message('delete'), {:action => 'delete', :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :confirm => message('dashboard.do_you_want_to_delete_dashboard'), :id => "delete-#{u active.name}" %>
<% else %>
- <%= link_to 'Unfollow', {:action => 'unfollow', :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :id => "unfollow-#{u active.name}" %>
+ <%= link_to message('unfollow'), {:action => 'unfollow', :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :id => "unfollow-#{u active.name}" %>
<% end %>
</td>
</tr>
@@ -59,18 +59,18 @@
</tbody>
</table>
<br/><br/>
- <h1 class="marginbottom10">Shared dashboards</h1>
+ <h1 class="marginbottom10"><%= message('dashboard.shared_dashboards') -%></h1>
<table class="data" id="shared-dashboards">
<thead>
<tr>
- <th>Name</th>
- <th>Shared by</th>
- <th>Operations</th>
+ <th><%= message('name') -%></th>
+ <th><%= message('shared_by') -%></th>
+ <th><%= message('operations') -%></th>
</tr>
</thead>
<tbody>
<% if @shared_dashboards.nil? || @shared_dashboards.empty? %>
- <tr class="even"><td colspan="5">No dashboards</td></tr>
+ <tr class="even"><td colspan="5"><%= message('dashboard.no_dashboard') -%></td></tr>
<%
else
@shared_dashboards.each do |dashboard| %>
@@ -85,7 +85,7 @@
<%= dashboard.user_name -%>
</td>
<td>
- <%= link_to 'Follow', {:action => 'follow', :id => dashboard.id, :resource => params[:resource]}, :method => :post, :id => "follow-#{u dashboard.name}" %>
+ <%= link_to message('follow'), {:action => 'follow', :id => dashboard.id, :resource => params[:resource]}, :method => :post, :id => "follow-#{u dashboard.name}" %>
</td>
</tr>
<% end