- Add I18n to dashboard page - Add I18n to dashboards managementtags/2.10
@@ -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 <b>{0}</b>. | |||
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 |
@@ -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 |
@@ -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> |
@@ -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) -%> |
@@ -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> |
@@ -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> |
@@ -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 %> |
@@ -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> |
@@ -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 %> |
@@ -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> |
@@ -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> |
@@ -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 |