aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general/search.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/general/search.rhtml')
-rw-r--r--app/views/general/search.rhtml72
1 files changed, 36 insertions, 36 deletions
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 29ce73d5c..876d54270 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -1,21 +1,20 @@
<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>
<% if @query.nil? %>
- <% @title = "Search Freedom of Information requests, public authorities and users" %>
+ <% @title = _("Search Freedom of Information requests, public authorities and users") %>
<h1><%=@title%></h1>
<% elsif @total_hits == 0 %>
- <% @title = "Nothing found for '" + h(@query) + "'" %>
+ <%= _("Nothing found for '{{search_terms}}'", :search_terms => h(@query)) %>
<% else %>
- <% @title = "Results page " + @page.to_s %>
+ <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>
<% @include_request_link_in_authority_listing = true %>
<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %>
<div id="stepwise_instructions">
- <p><strong>Next, select the public authority you'd like to make the request from.</strong></p>
- <p>Can't find it? <%= link_to "Browse all", list_public_bodies_default %> or
- <a href="/help/requesting#missing_body">ask us to add it</a>.</p>
+ <p><strong><%=_("Next, select the public authority you'd like to make the request from.") %></strong></p>
+ <p><% _('Can\'t find it? <a href="%s">Browse all</a> or <a href="%s">ask us to add it</a>.') % [list_public_bodies_default, "#{help_requesting_path}#missing_body"] %></p>
<p>
</div>
<% end %>
@@ -27,30 +26,31 @@
<% if @bodies %>
<%= hidden_field_tag 'bodies', 1 %>
<% end %>
- <%= submit_tag "Search" %>
+ <%= submit_tag _("Search") %>
<% if not @show_tips %>
- &nbsp;&nbsp;<a href="/search">Advanced search tips</a>
+ &nbsp;&nbsp;<%= link_to _('Advanced search tips'), search_redirect_path %>
<% end %>
</p>
<% end %>
<% if !@query.nil? %>
<p>
- <%=link_to_unless @sortby == 'relevant', "Show most relevant results first", search_url(@query, 'relevant') %>
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %>
|
- <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %>
<% if @sortby == 'described' %>
- | Recently described results first
+ | <%= _('Recently described results first') %>
<% end %>
</p>
<% end %>
<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
- <h1>No public authorities found</h1>
+ <h1><%= _('No public authorities found') %></h1>
<% if @spelling_correction %>
- <p id="did_you_mean">Did you mean: <%= search_link(@spelling_correction, @postfix) %></p>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}',
+ :correction => search_link(@spelling_correction, @postfix)) %></p>
<% end %>
- <p><%=link_to "Browse all", list_public_bodies_default %> or <a href="/help/requesting#missing_body">ask us to add one</a>.</p>
+ <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p>
<% end %>
<% if @total_hits == 0 %>
@@ -59,7 +59,7 @@
<% if not @query.nil? %>
<% if @spelling_correction %>
- <p id="did_you_mean">Did you mean: <%= search_link(@spelling_correction, @postfix) %></p>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
<% end %>
<% if (!@bodies || @xapian_requests.results.size == 0) && @track_thing && (@xapian_bodies.results.size > 0 || @xapian_users.results.size > 0 || @total_hits == 0)%>
@@ -67,7 +67,7 @@
<% end %>
<% if @xapian_bodies.results.size > 0 %>
- <h1><%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% for result in @xapian_bodies.results %>
<%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
@@ -77,7 +77,7 @@
<% end %>
<% if @xapian_users.results.size > 0 %>
- <h1><%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% for result in @xapian_users.results %>
<%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
@@ -87,7 +87,7 @@
<% end %>
<% if @xapian_requests.results.size > 0 %>
- <h1><%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% if @track_thing %>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
@@ -106,27 +106,27 @@
<% end %>
<% if @show_tips %>
- <h2>Advanced search tips</h2>
+ <h2><%= _("Advanced search tips")%></h2>
<ul>
- <li>Enter words that you want to find separated by spaces, e.g. <strong><%=search_link('climbing lane')%></strong></li>
- <li>Use OR (in capital letters) where you don't mind which word, e.g. <strong><%=search_link('commons OR lords')%></strong>
- <li>Use quotes when you want to find an exact phrase, e.g. <strong><%=search_link('"Liverpool City Council"')%></strong>
- <li><strong>status:</strong> to select based on the status or historical status of the request, see the <a href="#statuses">table of statuses</a> below.
- <li><strong>variety:</strong> to select type of thing to search for, see the <a href="#varieties">table of varieties</a> below.
- <li><strong><%=search_link('requested_from:home_office')%></strong> to search requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.
- <li><strong><%=search_link('requested_by:julian_todd')%></strong> to search requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.
- <li><strong><%=search_link('commented_by:tony_bowden')%></strong> to search annotations made by <%= link_to "Tony Bowden", show_user_url(:url_name => 'tony_bowden') %>, typing the name as in the URL.
- <li><strong>request:</strong> to restrict to a specific request, typing the title as in the URL.
- <li><strong><%=search_link('filetype:pdf')%></strong> to find all responses with PDF attachments. Or try these: <%= IncomingMessage.get_all_file_extentions%>.
- <li>Type <strong><%=search_link('01/01/2008..14/01/2008')%></strong> to only show things that happened in the first two weeks of January.
- <li><strong><%=search_link('tag:charity')%></strong> to find all public bodies or requests with a given tag. You can include multiple tags,
- and tag values, e.g. <%=search_link('tag:openlylocal AND tag:financial_transaction:335633')%>. Note that by default any of the tags
- can be present, you have to put AND explicitly if you only want results them all present.
- <li>Read about <a href="http://www.xapian.org/docs/queryparser.html">advanced search operators</a>, such as proximity and wildcards.
+ <li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li>
+ <li><%= _('Use OR (in capital letters) where you don\'t mind which word, e.g. <strong><code>commons OR lords</code></strong>') %>
+ <li><%= _('Use quotes when you want to find an exact phrase, e.g. <strong><code>"Liverpool City Council"</code></strong>') %></li>
+ <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="%s">table of statuses</a> below.') % "#statuses" %></li>
+ <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="%s">table of varieties</a> below.') % "#varieties" %></li>
+ <li><%= _('<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL.')%></li>
+ <li><%= _('<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL.') %></li>
+ <li><%= _('<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL.')%></li>
+ <li><%= _('<strong><code>request:</code></strong> to restrict to a specific request, typing the title as in the URL.')%>
+ <li><%= _('<strong><code>filetype:pdf</code></strong> to find all responses with PDF attachments. Or try these: <code>{{list_of_file_extensions}}</code>', :list_of_file_extensions => IncomingMessage.get_all_file_extentions)%></li>
+ <li><%= _('Type <strong><code>01/01/2008..14/01/2008</code></strong> to only show things that happened in the first two weeks of January.')%></li>
+ <li><%= _('<strong><code>tag:charity</code></strong> to find all public bodies or requests with a given tag. You can include multiple tags,
+ and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags
+ can be present, you have to put <code>AND</code> explicitly if you only want results them all present.')%></li>
+ <li><%= _('Read about <a href="%s">advanced search operators</a>, such as proximity and wildcards.') % "http://www.xapian.org/docs/queryparser.html" %></li>
</ul>
- <h2 id="statuses">Table of statuses</h2>
-
+ <h2 id="statuses"><%= _('Table of statuses') %></h2>
+ <h3>XXX this should be automatically generated</h3>
<table class="status_table">
<tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td> Waiting for the public authority to reply </td></tr>
<tr><td><strong><%=search_link('status:not_held')%></strong></td><td> The public authority does not have the information requested </td></tr>