diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-05 12:22:22 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-05 12:24:37 +0100 |
commit | 4ea160c7b48e895f88b71b3d05b962d6aa27d00c (patch) | |
tree | f5cb49f75c049b48021f1d216945c55935048af4 /sonar-server | |
parent | e03a8ada7e3f17c6e1fa768f3637917a46577649 (diff) | |
download | sonarqube-4ea160c7b48e895f88b71b3d05b962d6aa27d00c.tar.gz sonarqube-4ea160c7b48e895f88b71b3d05b962d6aa27d00c.zip |
SONAR-3825 improve l10n
Diffstat (limited to 'sonar-server')
7 files changed, 35 insertions, 30 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb index 143a6a5a9e0..b2ebe1a5c7e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb @@ -80,10 +80,12 @@ class MeasureFilter < ActiveRecord::Base @metrics ||= [] end - def metrics=(array) - @metrics = array + # Set the metrics of the result measures to load. Array of Metric or String. + def metrics=(array=[]) + @metrics = array.map{|m| m.is_a?(Metric) ? m : Metric.by_key(m)}.compact end + # Enable the loading of result links. False by default def require_links=(flag) @require_links=flag end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb index 59dc40aaa2e..7e1648f22a4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb @@ -23,6 +23,7 @@ class MeasureFilterDisplayTreemap < MeasureFilterDisplay KEY = :treemap PROPERTY_KEYS = Set.new(['tmSize', 'tmColor']) + MAX_RESULTS = 1000 attr_reader :id, :size, :size_metric, :color_metric def initialize(filter, options) @@ -35,7 +36,7 @@ class MeasureFilterDisplayTreemap < MeasureFilterDisplay filter.set_criteria_value('sort', "metric:#{@size_metric.key}") if @size_metric filter.set_criteria_value('asc', 'true') - filter.pagination.per_page = 500 + filter.pagination.per_page = MAX_RESULTS filter.pagination.page = 1 end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb index 8daad3011bb..46de81a4af9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb @@ -49,7 +49,8 @@ </table> <% end %> -<% content_for :script do %> +<% unless defined? widget + content_for :script do %> <script> $j(document).ready(function () { $j("#update-treemap").on("click", function (e) { @@ -67,10 +68,13 @@ }); }); </script> -<% end %> +<% end +end %> <% if filter.results.empty? %> <p><%= message('no_data') -%></p> +<% elsif filter.pagination.pages>1 %> + <p><%= message('measure_filter.too_many_results') -%></p> <% else %> <div id="tm-<%= treemap_id -%>" class="treemap width100"> <%= filter.display.html -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb index e6776650136..a94004f1607 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb @@ -29,10 +29,10 @@ } var hiddenConditionIndexes = [<%= hidden_condition_indexes.join(',') -%>]; $j(document).ready(function () { - $j('#select-lang').select2({allowClear:true, width:'100%', placeholder:'Languages'}); + $j('#select-lang').select2({allowClear:true, width:'100%', placeholder:'<%= message 'measure_filter.languages' -%>'}); $j('#select-qualifiers').select2({allowClear:true, width:'100%', placeholder:'Resources'}); $j('#more-criteria') - .select2({allowClear:true, width:'100%', placeholder:'+ More Criteria'}) + .select2({allowClear:true, width:'100%', placeholder:'<%= message 'measure_filter.more_criteria' -%>'}) .on("change", function (e) { $j("#criteria-" + e.val).insertBefore($j("#more-td")).show(); if (e.val == 'lang') { @@ -108,7 +108,7 @@ <input type="text" name="keyRegexp" value="<%= h @filter.criteria['keyRegexp'] -%>"> </li> <li id="criteria-fav" <%= "style='display:none'" unless @filter.criteria('onFavourites') -%>> - <%= message 'measure_filter.only_favourites' %>:<br> + <%= message 'measure_filter.criteria.only_favourites' %>:<br> <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%> </li> @@ -123,36 +123,36 @@ </li> <% end %> <li id="criteria-date" <%= "style='display:none'" unless @filter.criteria('fromDate') || @filter.criteria('toDate') -%>> - From date: + <%= message 'measure_filter.criteria.age.from_date' -%>: <input type="text" name="fromDate" value="<%= @filter.criteria['fromDate'] -%>" size="10" maxlength="10"> <br> - To date: + <%= message 'measure_filter.criteria.age.to_date' -%>: <input type="text" name="toDate" value="<%= @filter.criteria['toDate'] -%>" size="10" maxlength="10"><br> - <span class="note">year-month-day (2012-01-31)</span> + <span class="note"><%= message 'measure_filter.criteria.age.note' -%>:</span> </li> <li id="criteria-age" <%= "style='display:none'" unless @filter.criteria('ageMinDays') || @filter.criteria('ageMaxDays') -%>> - More than - <input type="text" name="ageMinDays" value="<%= @filter.criteria['ageMinDays'] -%>" size="3"> days ago - <br>Within the last - <input type="text" name="ageMaxDays" value="<%= @filter.criteria['ageMaxDays'] -%>" size="3"> days + <%= message 'measure_filter.criteria.age.more_than' -%>: + <input type="text" name="ageMinDays" value="<%= @filter.criteria['ageMinDays'] -%>" size="3"> <%= message 'measure_filter.criteria.age.days_ago' -%> + <br><%= message 'measure_filter.criteria.age.within_last' -%>: + <input type="text" name="ageMaxDays" value="<%= @filter.criteria['ageMaxDays'] -%>" size="3"> <%= message 'measure_filter.criteria.age.days' -%> </li> <li id="more-td"> <select id="more-criteria"> <option value=""></option> - <option value="age">Age</option> - <option value="date">Date</option> - <option value="fav">Favourites Only</option> - <option value="key">Key</option> - <option value="lang">Language</option> - <option value="metric">Metric</option> - <option value="name">Name</option> + <option value="age"><%= message 'measure_filter.criteria.age' -%></option> + <option value="date"><%= message 'measure_filter.criteria.date' -%></option> + <option value="fav"><%= message 'measure_filter.criteria.only_favourites' -%></option> + <option value="key"><%= message 'measure_filter.criteria.key' -%></option> + <option value="lang"><%= message 'measure_filter.criteria.language' -%></option> + <option value="metric"><%= message 'measure_filter.criteria.metric' -%></option> + <option value="name"><%= message 'measure_filter.criteria.name' -%></option> </select> </li> <li> <input type="button" name="search" value="<%= message('search_verb') -%>" onclick="submitSearch()"> </li> <li> - <a href="<%= ApplicationController.root_context -%>/measures" class="link-action">New search</a> + <a href="<%= ApplicationController.root_context -%>/measures" class="link-action"><%= message 'measure_filter.new_search' -%></a> <% if logged_in? %> <% if @filter.id==nil || @filter.user_id==current_user.id %> - <a id="save" href="<%= url_for params.merge({:action => 'save_form', :id => @filter.id}) -%>" class="link-action open-modal"><%= message('save') -%></a> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb index d4d3773f017..e1c9a1976ae 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb @@ -29,7 +29,7 @@ </div> <div class="page-split-right"> <div id="content"> - <h2>My Filters</h2> + <h2><%= message 'measure_filter.manage.my_filters' -%></h2> <table class="data marginbottom10" id="my-filters"> <thead> <tr> @@ -58,9 +58,9 @@ </td> <td> <% if filter.shared %> - Shared with all users + <%= message 'measure_filter.shared_with_all_users' -%> <% else %> - Private + <%= message 'measure_filter.private' -%> <% end %> </td> <td class="thin nowrap right"> @@ -84,7 +84,7 @@ <br/> - <h2>Shared Filters</h2> + <h2><%= message 'measure_filter.manage.shared_filters' -%></h2> <table class="data" id="shared-filters"> <thead> <tr> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index ac6c9ca7309..0af8480d965 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -17,7 +17,7 @@ </li> <% end %> <li class="last"> - Display as: + <%= message 'measure_filter.display_as' -%>: <% MeasureFilterDisplay.keys.each do |display_key| %> <%= link_to_if display_key!=@filter.display.key, message("measure_filter.display.#{display_key}"), params.merge(:action => 'search', :display => display_key, :id => @filter.id) -%> <% end %> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 903bec852fc..92232788e72 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -2140,7 +2140,6 @@ table.nowrap td, td.nowrap, th.nowrap { height: 24px; padding: 0 8px; cursor: pointer !important; - color: red !important; float: none !important; } @@ -2150,7 +2149,6 @@ table.nowrap td, td.nowrap, th.nowrap { .dropdown-menu li:hover a { color: #fff !important; - font-weight: bold !important; } .dropdown-menu a { |