sessions.remember_me=Remember me on this computer
sessions.log_in=Log in
+session.flash_notice.logged_in=Logged in.
+session.flash_notice.authentication_failed=Authentication failed.
+session.flash_notice.logged_out=You have been logged out.
#------------------------------------------------------------------------------
time_machine.set_as_default_for_all_users=Set as default (for all users)
+#------------------------------------------------------------------------------
+#
+# CLOUDS
+#
+#------------------------------------------------------------------------------
+
+cloud.quick_wins=Quick wins
+cloud.top_risk=Top risk
+
+
#------------------------------------------------------------------------------
#
# REVIEWS
events.name_required=Name (required)
+#------------------------------------------------------------------------------
+#
+# MAINTENANCE
+#
+#------------------------------------------------------------------------------
+
+maintenance.sonar_is_under_maintenance=Sonar is under maintenance.
+maintenance.please_check_back_later=Please check back later.
+maintenance.more_information=<p>Whilst waiting, you might want to check <a href="http://sonar-plugins.codehaus.org">new plugins</a> to extend the current functionality. </p><p>If you are an administrator and have no idea why this message is showing, you should read the <a href="http://docs.codehaus.org/display/SONAR/Upgrade+guide">upgrade guide</a>.</p>
+
+
#------------------------------------------------------------------------------
#
# METRIC DOMAINS
return access_denied
end
end
+
+ # i18n
+ def message(key, options={})
+ default = options[:default]
+ params = options[:params]
+ if params.nil?
+ params=[]
+ end
+ Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, key, default, params.to_java)
+ end
+
end
### Sessions Controller from restful_authentication (http://agilewebdevelopment.com/plugins/restful_authentication)
class SessionsController < ApplicationController
-
+
layout 'nonav'
skip_before_filter :check_authentication
self.current_user.remember_me
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
end
- flash[:notice] = 'Logged in.'
+ flash[:notice] = message('session.flash_notice.logged_in')
redirect_to(home_path)
else
- flash.now[:loginerror] = 'Authentication failed.'
+ flash.now[:loginerror] = message('session.flash_notice.authentication_failed')
end
end
self.current_user.forget_me
end
cookies.delete :auth_token
- flash[:notice]='You have been logged out.'
+ flash[:notice]=message('session.flash_notice.logged_out')
redirect_to(home_path)
reset_session
end
<form id="cloudform" action="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>" method="GET">
<ul class="headerLine">
<li>
- <span>Color:</span>
+ <span><%= message('color') -%>:</span>
<select name="color" onchange="document.forms['cloudform'].submit()">
<% if @snapshot.measure('coverage') %>
- <option value="coverage" <%= 'selected' if @color_metric.key=='coverage' -%>>Coverage</option>
+ <option value="coverage" <%= 'selected' if @color_metric.key=='coverage' -%>><%= message('metric.coverage.name') -%></option>
<% end %>
- <option value="violations_density" <%= 'selected' if @color_metric.key=='violations_density' -%>>Rules compliance</option>
+ <option value="violations_density" <%= 'selected' if @color_metric.key=='violations_density' -%>><%= message('metric.violations_density.name') -%></option>
</select>
</li>
<li class="sep"> </li>
<li>
<input type="radio" name="size" value="ncloc" <%= 'checked' if @size_metric.key=='ncloc' -%> onclick="document.forms['cloudform'].submit()" id="radio-quick">
- <label for="radio-quick">Quick wins</label></option>
+ <label for="radio-quick"><%= message('cloud.quick_wins') -%></label></option>
<input type="radio" name="size" value="function_complexity" <%= 'checked' if @size_metric.key=='function_complexity' -%> onclick="document.forms['cloudform'].submit()" id="radio-top">
- <label for="radio-top">Top risk</label></input>
+ <label for="radio-top"><%= message('cloud.top_risk') -%></label></input>
</li>
</ul>
</form>
</div>
<div id="content" class="with_sidebar">
<% if @project %><div class="print"><h2><%= @project.name(true) %></h2></div><% end %>
- <div class="error" id="error" style="display:none"><span id="errormsg"></span> [<a href="#" onclick="javascript:$('error').hide();return false;">hide</a>]</div>
- <div class="notice" id="info" style="display:none"><span id="infomsg"></span> [<a href="#" onclick="javascript:$('info').hide();return false;">hide</a>]</div>
- <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> [<a href="#" onclick="javascript:$('warning').hide();return false;">hide</a>]</div>
+ <div class="error" id="error" style="display:none"><span id="errormsg"></span> [<a href="#" onclick="javascript:$('error').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+ <div class="notice" id="info" style="display:none"><span id="infomsg"></span> [<a href="#" onclick="javascript:$('info').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+ <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> [<a href="#" onclick="javascript:$('warning').hide();return false;"><%= message('hide').downcase -%></a>]</div>
<%= yield %>
</div>
</div>
<div id="body" class="nolayout">
<% if @snapshot %><div class="print"><h2><%= @snapshot.project.name(true) %></h2></div><% end %>
- <div class="error" id="error" style="display:none"><span id="errormsg"></span> [<a href="#" onclick="javascript:$('error').hide();return false;">hide</a>]</div>
- <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> [<a href="#" onclick="javascript:$('warning').hide();return false;">hide</a>]</div>
- <div class="notice" id="info" style="display:none"><span id="infomsg"></span> [<a href="#" onclick="javascript:$('info').hide();return false;">hide</a>]</div>
+ <div class="error" id="error" style="display:none"><span id="errormsg"></span> [<a href="#" onclick="javascript:$('error').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+ <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> [<a href="#" onclick="javascript:$('warning').hide();return false;"><%= message('hide').downcase -%></a>]</div>
+ <div class="notice" id="info" style="display:none"><span id="infomsg"></span> [<a href="#" onclick="javascript:$('info').hide();return false;"><%= message('hide').downcase -%></a>]</div>
<%= yield %>
</div>
\ No newline at end of file
<div id="maintenance">
<div id="maintenancelogo"><a href="http://www.sonarsource.org"><%= image_tag('sonar.png', :class => 'png') -%></a></div>
-<h1>Sonar is under maintenance. Please <a href="<%= ApplicationController.root_context -%>/">check back</a> later.</h1>
-<p>Whilst waiting, you might want to check <a href="http://sonar-plugins.codehaus.org">new plugins</a> to extend the current functionality. </p>
-<p>If you are an administrator and have no idea why this message is showing, you should read the <a href="http://docs.codehaus.org/display/SONAR/Upgrade+guide">upgrade guide</a>.</p>
+<h1><%= message('maintenance.sonar_is_under_maintenance') -%> <a href="<%= ApplicationController.root_context -%>/"><%= message('maintenance.please_check_back_later') -%></a></h1>
+<%= message('maintenance.more_information') -%>
</div>
\ No newline at end of file