diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-13 15:39:56 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-13 15:39:56 +0200 |
commit | dff9de8cb6b737135050e29bde0c558dee88424a (patch) | |
tree | 61c7365948ad3efadf06cc7c18b5e828768db723 /sonar-server | |
parent | 3d048ccaea9148d0e72b9f5d46007f7a51945723 (diff) | |
download | sonarqube-dff9de8cb6b737135050e29bde0c558dee88424a.tar.gz sonarqube-dff9de8cb6b737135050e29bde0c558dee88424a.zip |
SONAR-2589 Modification of web ruby templates to use bundles
- Add i18n to all filters page
- Modify the I18nManager to return the key if a translation has not
been found (instead of throwing a SonarException)
Diffstat (limited to 'sonar-server')
15 files changed, 87 insertions, 121 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 38000871ab7..6866a11cd8c 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 @@ -41,7 +41,7 @@ module ApplicationHelper def qualifier_icon(object) qualifier=(object.respond_to?('qualifier') ? object.qualifier : object.to_s) if qualifier - image_tag("q/#{qualifier}.png", :alt => Resourceable.qualifier_name(qualifier)) + image_tag("q/#{qualifier}.png", :alt => message(Resourceable.qualifier_name(qualifier))) else image_tag('e16.gif') end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb index 81f59c5ffb3..4f827a2823d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb @@ -171,14 +171,14 @@ module FiltersHelper def period_name(property) if property=='previous_analysis' - "Δ since previous analysis" + message('delta_since_previous_analysis') elsif property =~ /^[\d]+(\.[\d]+){0,1}$/ # is integer - "Δ over #{property} days" + message('delta_over_x_days', :params => property) elsif property =~ /\d{4}-\d{2}-\d{2}/ - "Δ since #{property}" + message('delta_since', :params => property) elsif !property.blank? - "Δ since version #{property}" + message('delta_since_version', :params => property) else nil end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb index d2208f6e47f..8b014ac9e57 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb @@ -23,7 +23,7 @@ class FilterColumn < ActiveRecord::Base belongs_to :filter validates_inclusion_of :sort_direction, :in => %w( ASC DESC ), :allow_nil => true - + def self.create_from_string(string) if FAMILIES.include?(string) FilterColumn.new(:family => string) @@ -39,48 +39,14 @@ class FilterColumn < ActiveRecord::Base def name if on_metric? - metric ? metric.short_name : kee + Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, "metric." + kee + ".name", nil, [].to_java) else - case family - when 'date' - 'Build date' - when 'language' - 'Language' - when 'name' - 'Name' - when 'links' - 'Links' - when 'version' - 'Version' - when 'key' - 'Key' - else - kee - end + Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, family, kee, [].to_java) end end def display_name - if on_metric? - metric ? metric.short_name : kee - else - case family - when 'date' - 'Build date' - when 'language' - 'Language' - when 'name' - 'Name' - when 'links' - 'Links' - when 'version' - 'Version' - when 'key' - 'Key' - else - kee - end - end + name end def metric diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_criterion.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_criterion.html.erb index 93067046dda..34d80b2abce 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_criterion.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_criterion.html.erb @@ -7,7 +7,7 @@ } </script> <select name="criteria[<%= id -%>][metric_id]" id="metric-<%= id -%>"> - <option value="">Select a metric</option> + <option value=""><%= message('select_a_metric') -%></option> <% Metric.domains.each do |domain| %> <optgroup label="<%= h domain -%>"> <% Metric.by_domain(domain).select{|m| !m.data? && !m.hidden?}.each do |metric| %> @@ -17,16 +17,16 @@ <% end %> </select> <select name="criteria[<%= id -%>][type]" id="type-<%= id -%>"> - <option value="value" <%= 'selected' unless (criterion && criterion.variation) -%>>Value</option> - <option value="variation" <%= 'selected' if criterion && criterion.variation -%>>Variation</option> + <option value="value" <%= 'selected' unless (criterion && criterion.variation) -%>><%= message('value') -%></option> + <option value="variation" <%= 'selected' if criterion && criterion.variation -%>><%= message('variation') -%></option> </select> <select name="criteria[<%= id -%>][operator]" id="op-<%= id -%>"> <option value=""></option> - <option value="<" <%= 'selected' if (criterion && criterion.operator=='<') -%>>Less than</option> - <option value="<=" <%= 'selected' if (criterion && criterion.operator=='<=') -%>>Less or equals</option> - <option value="=" <%= 'selected' if (criterion && criterion.operator=='=') -%>>Equals</option> - <option value=">" <%= 'selected' if (criterion && criterion.operator=='>') -%>>Greater than</option> - <option value=">=" <%= 'selected' if (criterion && criterion.operator=='>=') -%>>Greater or equals</option> + <option value="<" <%= 'selected' if (criterion && criterion.operator=='<') -%>><%= message('less_than') -%></option> + <option value="<=" <%= 'selected' if (criterion && criterion.operator=='<=') -%>><%= message('less_or_equals') -%></option> + <option value="=" <%= 'selected' if (criterion && criterion.operator=='=') -%>><%= message('equals') -%></option> + <option value=">" <%= 'selected' if (criterion && criterion.operator=='>') -%>><%= message('greater_than') -%></option> + <option value=">=" <%= 'selected' if (criterion && criterion.operator=='>=') -%>><%= message('greater_or_equals') -%></option> </select> <input type="text" name="criteria[<%= id -%>][value]" size="5" value="<%= criterion.value if criterion -%>" id="val-<%= id -%>"></input> -<a href="#" onClick="reset_criterion(<%= id -%>);return false;">Reset</a>
\ No newline at end of file +<a href="#" onClick="reset_criterion(<%= id -%>);return false;"><%= message('reset_verb') -%></a>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_list.html.erb index d899960b1eb..69d17e09b5e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_list.html.erb @@ -1,12 +1,12 @@ <tr> <td class="first"> - Add column: + <%= message('filters.add_column') -%>: </td> <td> <form id="add_column_form" action="<%= url_for :action => 'add_column', :id => @filter.id -%>" method="post"> <select name="column_type" id="select_column_type"> - <option value="value" selected>Value</option> - <option value="variation">Variation</option> + <option value="value" selected><%= message('value') -%></option> + <option value="variation"><%= message('variation') -%></option> </select> <select name="column" id="select_column"> @@ -17,22 +17,22 @@ <% if metric.display? %><option value="metric,<%= metric.id -%>"><%= metric.short_name -%></option><% end %> <% end %> <% if domain=='General' %> - <% unless @filter.column('date') %><option value="date">Build date</option><% end %> - <% unless @filter.column('key') %><option value="key">Key</option><% end %> - <% unless @filter.column('language') %><option value="language">Language</option><% end %> - <% unless @filter.column('links') %><option value="links">Links</option><% end %> - <% unless @filter.column('name') %><option value="name">Name</option><% end %> - <% unless @filter.column('version') %><option value="version">Version</option><% end %> + <% unless @filter.column('date') %><option value="date"><%= message('build_date') -%></option><% end %> + <% unless @filter.column('key') %><option value="key"><%= message('key') -%></option><% end %> + <% unless @filter.column('language') %><option value="language"><%= message('language') -%></option><% end %> + <% unless @filter.column('links') %><option value="links"><%= message('links') -%></option><% end %> + <% unless @filter.column('name') %><option value="name"><%= message('name') -%></option><% end %> + <% unless @filter.column('version') %><option value="version"><%= message('version') -%></option><% end %> <% end %> </optgroup> <% end %> </select> - <input type="submit" id="add_column_button" value="Add"></input> + <input type="submit" id="add_column_button" value="<%= message('add_verb') -%>"></input> </form> </td> </tr> <tr> - <td class="first">Default sorted column:</td> + <td class="first"><%= message('filters.default_sorted_column') -%>:</td> <td> <form id="sorted_column_form" action="<%= url_for :action => 'set_sorted_column' -%>" method="post"> <select name="id"> @@ -44,20 +44,20 @@ <% end %> </select> <select name="sort"> - <option value="ASC" <%= 'selected' if default_sorted_column && default_sorted_column.ascending? -%>>Ascending</option> - <option value="DESC" <%= 'selected' if default_sorted_column && default_sorted_column.descending? -%>>Descending</option> + <option value="ASC" <%= 'selected' if default_sorted_column && default_sorted_column.ascending? -%>><%= message('ascending') -%></option> + <option value="DESC" <%= 'selected' if default_sorted_column && default_sorted_column.descending? -%>><%= message('descending') -%></option> </select> - <input type="submit" id="add_column_submit" value="Change" /> + <input type="submit" id="add_column_submit" value="<%= message('change_verb') -%>" /> </form> </td> </tr> <tr> - <td class="first">Page size:</td> + <td class="first"><%= message('page_size') -%>:</td> <td> <form id="page_size_form" action="<%= url_for :action => 'set_page_size' -%>" method="post"> <input type="hidden" name="id" value="<%= @filter.id -%>"></input> <input type="text" name="size" value="<%= @filter.page_size -%>" maxsize="3" size="3"></input> - <input type="submit" id="set_page_size_submit" value="Change"/> - <span class="comments">Min <%= ::Filter::MIN_PAGE_SIZE -%>, max <%= ::Filter::MAX_PAGE_SIZE -%></span> + <input type="submit" id="set_page_size_submit" value="<%= message('change_verb') -%>"/> + <span class="comments"><%= message('min') -%> <%= ::Filter::MIN_PAGE_SIZE -%>, <%= message('max').downcase -%> <%= ::Filter::MAX_PAGE_SIZE -%></span> </td> </tr>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_treemap.html.erb index 39c8b2dc1e3..748def5b202 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_customize_treemap.html.erb @@ -5,14 +5,14 @@ %> <form class="admin" action="<%= url_for :action => 'set_columns', :id => @filter.id -%>" method="POST"> <tr> - <td class="first">Size:</td> + <td class="first"><%= message('size') -%>:</td> <td> <%= select_tag 'columns[]', options_grouped_by_domain(Sonar::TreemapBuilder.size_metrics({:exclude_user_managed => true}), size_metric.key), :id => 'size_metric' %> </td> </tr> <tr> - <td class="first">Color:</td> + <td class="first"><%= message('color') -%>:</td> <td> <%= select_tag 'columns[]', options_grouped_by_domain(Sonar::TreemapBuilder.color_metrics, color_metric.key), :id => 'color_metric' %> @@ -22,7 +22,7 @@ <tr> <td class="first"> </td> <td> - <input type="submit" value="Change"> + <input type="submit" value="<%= message('change_verb') -%>"> </td> </tr> </form>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb index b6231d2f023..78b86a04143 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb @@ -5,7 +5,7 @@ <div class="operations"> <form action="<%= url_for :overwrite_params => {:period => nil} -%>" style="display: inline" method="get"> <select name="period" onchange="submit()" class="small"> - <option value="">Time changes...</option> + <option value=""><%= message('time_changes') -%>...</option> <% period_names.each_with_index do |name, index| %> <option value="<%= index+1 -%>" <%= 'selected' if @filter_context.period_index==index+1 -%>><%= name -%></value> <% end %> @@ -28,9 +28,9 @@ <tr class="admin"><th></th> <% filter.columns.each do |column| %> <th nowrap class="<%= column_align(column) -%>"> - <%= link_to image_tag("controls/resultset_previous.png"), {:action => 'left_column', :id => column.id}, :title => 'Move left', :method => :post if filter.first_column!=column %> - <%= link_to image_tag("bin_closed.png"), {:action => 'delete_column', :id => column.id}, :title => 'Remove this column', :method => :post if column.deletable? %> - <%= link_to image_tag("controls/resultset_next.png"), {:action => 'right_column', :id => column.id}, :title => 'Move right', :method => :post if filter.last_column!=column %> + <%= link_to image_tag("controls/resultset_previous.png"), {:action => 'left_column', :id => column.id}, :title => message('move_left'), :method => :post if filter.first_column!=column %> + <%= link_to image_tag("bin_closed.png"), {:action => 'delete_column', :id => column.id}, :title => message('remove_column'), :method => :post if column.deletable? %> + <%= link_to image_tag("controls/resultset_next.png"), {:action => 'right_column', :id => column.id}, :title => message('move_right'), :method => :post if filter.last_column!=column %> </th> <% end %> </tr> @@ -40,7 +40,7 @@ <tfoot> <tr> <td colspan="<%= filter.columns.size + 1 -%>"> - <span id="results_count"><%= pluralize(@filter_context.size, 'result') %></span> + <span id="results_count"><%= pluralize(@filter_context.size, message('result').downcase) %></span> <% if @filter_context.page_count>1 %> | @@ -53,7 +53,7 @@ <% if @filter.projects_homepage? %> <a href="<%= url_for :controller => :feeds, :action => 'projects', :id => EventCategory::KEY_ALERT -%>" class="nolink"><%= image_tag 'rss-12x12.png' %></a> - <a href="<%= url_for :controller => :feeds, :action => 'projects', :id => EventCategory::KEY_ALERT -%>" class="action">Alerts feed</a> + <a href="<%= url_for :controller => :feeds, :action => 'projects', :id => EventCategory::KEY_ALERT -%>" class="action"><%= message('alerts_feed') -%></a> <% end %> </td> </tr> @@ -129,6 +129,6 @@ </table> <br/> <% if @filter_context.security_exclusions? %> - <p class="notes">Due to security settings, some results are not being displayed.</p> + <p class="notes"><%= message('results_not_display_due_to_security') -%></p> <% end %> </div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_tabs.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_tabs.html.erb index dddf84fb4ed..d6570269035 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_tabs.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_tabs.html.erb @@ -1,11 +1,11 @@ <% if logged_in? %> <div id="page-operations"> <ul class="operations"> - <li><a href="<%= url_for :action => 'new' -%>" >Add filter</a></li> + <li><a href="<%= url_for :action => 'new' -%>" ><%= message('filters.add_filter') -%></a></li> <% if @filter && @filter.id && editable_filter?(@filter) %> - <li><a href="<%= url_for :action => 'edit', :id => @filter.id -%>">Edit filter</a></li> + <li><a href="<%= url_for :action => 'edit', :id => @filter.id -%>"><%= message('filters.edit_filter') -%></a></li> <% end %> - <li class="last"><%= link_to 'Manage filters', {:action => 'manage'} -%></li> + <li class="last"><%= link_to message('filters.manage_filters'), {:action => 'manage'} -%></li> </ul> </div> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb index f927de3ecb4..93d0455651d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb @@ -1,5 +1,5 @@ <% if @filter.period? %> -Treemap does not support yet the selection of a period. +<%= message('filters.treemap_not_supported_for_period_selection') -%> <% else %> <% diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb index abf745ddd85..2c8b206dff1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/manage.html.erb @@ -1,20 +1,20 @@ <%= render :partial => 'filters/tabs', :locals => {:selected_tab => nil} %> -<h1>My filters</h1> +<h1><%= message('filters.my_filters') -%></h1> <br/> <table class="data" id="actives"> <thead> <tr> - <th>Name</th> - <th>Author</th> - <th>Shared</th> - <th>Order</th> - <th>Operations</th> + <th><%= message('name') -%></th> + <th><%= message('author') -%></th> + <th><%= message('shared') -%></th> + <th><%= message('order') -%></th> + <th><%= message('operations') -%></th> </tr> </thead> <tbody> <% if @actives.nil? || @actives.empty? %> - <tr class="even"><td colspan="5">No filters</td></tr> + <tr class="even"><td colspan="5"><%= message('filters.no_filters') -%></td></tr> <% else @@ -39,10 +39,10 @@ </td> <td> <% if editable_filter?(active.filter) %> - <%= link_to 'Edit', {:action => 'edit', :id => active.filter_id}, :id => "edit-#{u active.name}" %> | - <%= link_to 'Delete', {:action => 'deactivate', :id => active.filter_id}, :method => :post, :confirm => 'Do you want to delete this filter ?', :id => "delete-#{u active.name}" %> + <%= link_to message('edit'), {:action => 'edit', :id => active.filter_id}, :id => "edit-#{u active.name}" %> | + <%= link_to message('delete'), {:action => 'deactivate', :id => active.filter_id}, :method => :post, :confirm => message('filters.do_you_want_to_delete'), :id => "delete-#{u active.name}" %> <% else %> - <%= link_to 'Unfollow', {:action => 'deactivate', :id => active.filter_id}, :method => :post, :confirm => 'Do you want to stop following this filter ?', :id => "unfollow-#{u active.name}" %> + <%= link_to message('unfollow'), {:action => 'deactivate', :id => active.filter_id}, :method => :post, :confirm => message('filters.do_you_want_to_stop_following'), :id => "unfollow-#{u active.name}" %> <% end %> </td> </tr> @@ -53,20 +53,20 @@ </table> <br/><br/><br/> -<h1>Shared filters</h1> -<p>These filters are shared by administrators and can be followed without copying them.</p> +<h1><%= message('filters.shared_filters') -%></h1> +<p><%= message('filters.shared_filters_description') -%></p> <br/> <table class="data" id="shared"> <thead> <tr> - <th>Name</th> - <th>Author</th> - <th>Operations</th> + <th><%= message('name') -%></th> + <th><%= message('author') -%></th> + <th><%= message('operations') -%></th> </tr> </thead> <tbody> <% if @shared_filters.nil? || @shared_filters.empty? %> - <tr class="even"><td colspan="3">No results.</td></tr> + <tr class="even"><td colspan="3"><%= message('no_results') -%>.</td></tr> <% else %> <% @shared_filters.each do |filter| %> <tr class="<%= cycle('even', 'odd') -%>"> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb index 37568acf65a..654cbca200b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb @@ -184,16 +184,16 @@ $('name').focus(); <br/> <% if @filter_context %> - <h1>Display</h1> + <h1><%= message('display') -%></h1> <div class="admin"> <table class="form" id="view-form"> <tr> - <td class="first">Display as:</td> + <td class="first"><%= message('filters.display_as') -%>:</td> <td> <form action="<%= url_for :action => :set_view, :id => @filter.id -%>" method="POST"> - <input type="radio" name="view" value="list" <%= 'checked' if @filter.default_view==::Filter::VIEW_LIST -%> id="view-list" onClick="$('view-loading').show();submit();"></input> <label for="view-list">Table</label> + <input type="radio" name="view" value="list" <%= 'checked' if @filter.default_view==::Filter::VIEW_LIST -%> id="view-list" onClick="$('view-loading').show();submit();"></input> <label for="view-list"><%= message('table') -%></label> <span class="spacer"> </span> - <input type="radio" name="view" value="treemap" <%= 'checked' if @filter.default_view==::Filter::VIEW_TREEMAP -%> id="view-treemap" onClick="$('view-loading').show();submit();"></input> <label for="view-treemap">Treemap</label> + <input type="radio" name="view" value="treemap" <%= 'checked' if @filter.default_view==::Filter::VIEW_TREEMAP -%> id="view-treemap" onClick="$('view-loading').show();submit();"></input> <label for="view-treemap"><%= message('treemap') -%></label> <span class="spacer"> </span> <%= image_tag 'loading.gif', :id => 'view-loading', :style=>'display: none' %> </form> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/search_path.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/search_path.html.erb index 02dc65cf144..a3dc8ced1fe 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/search_path.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/search_path.html.erb @@ -1,10 +1,10 @@ -<h1>Search</h1> +<h1><%= message('search_verb') -%></h1> <br/> <form action="<%= url_for :action => :search_path -%>" method="post" id="search_form"> <input type="text" name="search" id="search" value="<%= params[:search] -%>"></input> - <input type="submit" value="Search" id="search_submit" /><br/> - <p class="note">Search by name</p> + <input type="submit" value="<%= message('search_verb') -%>" id="search_submit" /><br/> + <p class="note"><%= message('filters.search_by_name') -%></p> </form> <br/> @@ -28,7 +28,7 @@ </thead> <tbody> <% if @snapshots.empty? %> - <tr class="even"><td colspan="3">No results</td></tr> + <tr class="even"><td colspan="3"><%= message('no_results') -%></td></tr> <% else @snapshots.each do |snapshot| %> @@ -38,7 +38,7 @@ <% path_name=snapshot.path_name %> <%= path_name -%> </td> - <td><a href="#" onClick="selectPath(<%= snapshot.project_id-%>, '<%= escape_javascript(path_name) -%>')">Select</a></td> + <td><a href="#" onClick="selectPath(<%= snapshot.project_id-%>, '<%= escape_javascript(path_name) -%>')"><%= message('select_verb') -%></a></td> </tr> <% end end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/treemap.html.erb index dbe6685989b..ade8c73ef2f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/treemap.html.erb @@ -3,13 +3,13 @@ <table> <tr> <td> - <span class="comments">Size:</span><br/> + <span class="comments"><%= message('size') -%>:</span><br/> <%= select_tag 'size_metric', options_grouped_by_domain(Sonar::TreemapBuilder.size_metrics({:exclude_user_managed => true}), @size_metric.key), :id => 'size_metric', :class => 'small', :onchange => "load_treemap(this.form.size_metric.value,this.form.color_metric.value, false);return false;" %> </td> <td class="sep"> </td> <td> - <span class="comments">Color: <%= render :partial => 'components/treemap_gradient', :locals => {:color_metric => @color_metric} %></span> + <span class="comments"><%= message('color') -%>: <%= render :partial => 'components/treemap_gradient', :locals => {:color_metric => @color_metric} %></span> <br/> <%= select_tag 'color_metric', options_grouped_by_domain(Sonar::TreemapBuilder.color_metrics, @color_metric.key), :id => 'color_metric', :class => 'small', :onchange => "load_treemap(this.form.size_metric.value,this.form.color_metric.value, false);return false;" %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 659f24ad4e6..004552333e9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -3,7 +3,7 @@ <div id="hd"> <%= render :partial => 'layouts/breadcrumb' %> <ol id="nav"> - <li><input type="text" autocomplete="off" size="15" name="search" id="projectSearch" onFocus="this.size=30;this.value='';autocompleteProjects('<%= ApplicationController.root_context -%>/api/resources?scopes=<%= Project::SCOPE_SET -%>&qualifiers=<%= Project::QUALIFIER_VIEW-%>,<%= Project::QUALIFIER_SUBVIEW-%>,<%= Project::QUALIFIER_PROJECT-%>', '<%= ApplicationController.root_context -%>/dashboard/index/', this, $('projectResults'));return true;" onBlur="javacript:this.size=15" value="Search"/><div id="projectResults" style="display:none"></div></li> + <li><input type="text" autocomplete="off" size="15" name="search" id="projectSearch" onFocus="this.size=30;this.value='';autocompleteProjects('<%= ApplicationController.root_context -%>/api/resources?scopes=<%= Project::SCOPE_SET -%>&qualifiers=<%= Project::QUALIFIER_VIEW-%>,<%= Project::QUALIFIER_SUBVIEW-%>,<%= Project::QUALIFIER_PROJECT-%>', '<%= ApplicationController.root_context -%>/dashboard/index/', this, $('projectResults'));return true;" onBlur="javacript:this.size=15" value="<%= message('search_verb') -%>"/><div id="projectResults" style="display:none"></div></li> <li> <a href="javascript:window.print()"><img src="<%= ApplicationController.root_context -%>/images/print.gif" alt="<%= message('layout.print') -%>" title="<%=message('layout.print')-%>" /></a> <% if @project %><a href="<%= url_for :overwrite_params => {:id => @project.key}-%>" id="permalink"><img src="<%= ApplicationController.root_context -%>/images/permalink.gif" alt="<%=message('layout.permalink')-%>" title="<%=message('layout.permalink')-%>" /></a><% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/lib/resourceable.rb b/sonar-server/src/main/webapp/WEB-INF/lib/resourceable.rb index a880840fde5..341d249bbcc 100644 --- a/sonar-server/src/main/webapp/WEB-INF/lib/resourceable.rb +++ b/sonar-server/src/main/webapp/WEB-INF/lib/resourceable.rb @@ -37,16 +37,16 @@ module Resourceable QUALIFIER_LIB='LIB' QUALIFIERS=[QUALIFIER_VIEW,QUALIFIER_SUBVIEW,QUALIFIER_PROJECT,QUALIFIER_MODULE,QUALIFIER_DIRECTORY,QUALIFIER_PACKAGE,QUALIFIER_FILE,QUALIFIER_CLASS,QUALIFIER_UNIT_TEST_CLASS,QUALIFIER_LIB] QUALIFIER_NAMES={ - QUALIFIER_VIEW => 'View', - QUALIFIER_SUBVIEW => 'Sub-view', - QUALIFIER_PROJECT => 'Project', - QUALIFIER_MODULE => 'Sub-project', - QUALIFIER_DIRECTORY => 'Directory', - QUALIFIER_PACKAGE => 'Package', - QUALIFIER_FILE => 'File', - QUALIFIER_CLASS => 'Class', - QUALIFIER_UNIT_TEST_CLASS => 'Unit test', - QUALIFIER_LIB => 'Library' + QUALIFIER_VIEW => 'view', + QUALIFIER_SUBVIEW => 'sub_view', + QUALIFIER_PROJECT => 'project', + QUALIFIER_MODULE => 'sub_project', + QUALIFIER_DIRECTORY => 'directory', + QUALIFIER_PACKAGE => 'package', + QUALIFIER_FILE => 'file', + QUALIFIER_CLASS => 'class', + QUALIFIER_UNIT_TEST_CLASS => 'unit_test', + QUALIFIER_LIB => 'library' } def set? scope==SCOPE_SET |