]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 improve l10n
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 11:22:22 +0000 (12:22 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 11:24:37 +0000 (12:24 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter.rb
sonar-server/src/main/webapp/WEB-INF/app/models/measure_filter_display_treemap.rb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb
sonar-server/src/main/webapp/stylesheets/style.css

index e7af1a9090906235b9a14b79142a1e928af761d1..95c4313c358d8e4d9a48dbfe4f29d000806002c6 100644 (file)
@@ -380,6 +380,28 @@ session.flash_notice.logged_out=You have been logged out.
 # MEASURE FILTERS
 #
 #------------------------------------------------------------------------------
+measure_filter.display_as=Display as
+measure_filter.shared_with_all_users=Shared with all users
+measure_filter.private=Private
+measure_filter.manage.shared_filters=Shared Filters
+measure_filter.manage.my_filters=My Filters
+measure_filter.criteria.age=Age
+measure_filter.criteria.date=Date
+measure_filter.criteria.only_favourites=Favourites only
+measure_filter.criteria.key=Key
+measure_filter.criteria.name=Name
+measure_filter.criteria.language=Language
+measure_filter.criteria.metric=Metric
+measure_filter.criteria.age.from_date=From date
+measure_filter.criteria.age.to_date=To date
+measure_filter.criteria.age.note=year-month-day (2012-01-31)
+measure_filter.criteria.age.more_than=More than
+measure_filter.criteria.age.within_last=Within the last
+measure_filter.criteria.age.days_ago=days ago
+measure_filter.criteria.age.days=days
+measure_filter.new_search=New search
+measure_filter.more_criteria=+ More Criteria
+measure_filter.languages=Languages
 measure_filter.col.date=Date
 measure_filter.col.description=Description
 measure_filter.col.key=Key
@@ -388,8 +410,6 @@ measure_filter.col.links=Links
 measure_filter.col.name=Name
 measure_filter.col.short_name=Short Name
 measure_filter.col.version=Version
-measure_filter.short_col.language=Lang.
-measure_filter.short_col.short_name=Name
 measure_filter.missing_name=Name is missing
 measure_filter.name_too_long=Name is too long
 measure_filter.sharing=Sharing
@@ -398,11 +418,11 @@ measure_filter.are_you_sure_want_delete_filter_x=Are you sure that you want to d
 measure_filter.title_shared_filters=Shared Filters
 measure_filter.key_like=Key like
 measure_filter.name_contains=Name contains
-measure_filter.only_favourites=Favourites only
 measure_filter.manage_filters=Manage Filters
 measure_filter.display.list=List
 measure_filter.display.treemap=Treemap
 measure_filter.configure_columns=Configure Columns
+measure_filter.too_many_results=Too many results. Please refine your search.
 
 #------------------------------------------------------------------------------
 #
index 143a6a5a9e02281b6eda2937f6609b9b48782bdf..b2ebe1a5c7e4eefaeb7e9b7ddc7b99b2b17d5278 100644 (file)
@@ -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
index 59dc40aaa2e7e3f7c1789f8dad249ab344eef065..7e1648f22a42b54e3195f602bba893711c3d2cb5 100644 (file)
@@ -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
 
index 8daad3011bb7ed51553b4c27df356b02fa9115c5..46de81a4af9d9e72be2fcc1c29c1157110c06ac1 100644 (file)
@@ -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) {
       });
     });
   </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 -%>
index e6776650136643c6a0faf47bf427a533afa6951d..a94004f1607973149925ae45a2133d4bf8377ef5 100644 (file)
     }
     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') {
       <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>
 
       </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>
index d4d3773f017bd6dffad7aa442486373aaaf6ff6c..e1c9a1976aee55dc7b95a622e74b1fb7d0a1f837 100644 (file)
@@ -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>
index ac6c9ca7309d792cf62012160b6e3c6d0109d3f8..0af8480d9651f2b1f218bfe0adce1af40724d23b 100644 (file)
@@ -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 %>
index 903bec852fc5af4bd7e2d1677ff0c1a46ab1f083..92232788e72edc966800f059cacf3510ede1442e 100644 (file)
@@ -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 {