aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/general/search.rhtml72
-rw-r--r--app/views/public_body/show.rhtml56
-rw-r--r--config/routes.rb1
3 files changed, 64 insertions, 65 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>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index c1deea762..f93518b7a 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -1,33 +1,34 @@
<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %>
<div id="request_sidebar">
- <h2>Track this authority</h2>
+ <h2><%= _('Track this authority')%></h2>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
- <h2>More about this authority</h2>
+ <h2><%= _('More about this authority')%></h2>
<% if !@public_body.calculated_home_page.nil? %>
- <%= link_to "Home page of authority", @public_body.calculated_home_page %><br>
+ <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br>
<% end %>
<% if !@public_body.publication_scheme.empty? %>
- <%= link_to "Publication scheme", @public_body.publication_scheme %><br>
+ <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br>
<% end %>
<% if @public_body.has_tag?("charity") %>
<% for tag_value in @public_body.get_tag_values("charity") %>
+ XXX UK-specific
<% if tag_value.match(/^SC/) %>
- <%= link_to "Charity registration", "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br>
+ <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br>
<% else %>
- <%= link_to "Charity registration", "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br>
+ <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br>
<% end %>
<% end %>
<% end %>
- <%= link_to "View FOI email address", view_public_body_email_url(@public_body.url_name) %><br>
+ <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
</div>
<h1><%=h(@public_body.name)%></h1>
<p class="subtitle">
-<%=@public_body.type_of_authority(true)%> in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %>
+<%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>, <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %>
<% if !@user.nil? && @user.admin_page_links? %>
-(<%= link_to "admin", public_body_admin_url(@public_body) %>)
+(<%= link_to _("admin"), public_body_admin_url(@public_body) %>)
<% end %>
</p>
@@ -36,51 +37,48 @@
<% end %>
<% if @public_body.eir_only? %>
- <p>You can only request information about the environment from this authority.</p>
+ <p><%= _('You can only request information about the environment from this authority.')%></p>
<% end %>
<div id="stepwise_make_request">
<strong>
<% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
- <% make = 'Make' %>
- <% if @searched_to_send_request %>
- Next,
- <% make = 'make' %>
- <% end %>
<% if @public_body.eir_only? %>
- <%= link_to make + " a new Environmental Information request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= link_to "Make a new Environmental Information request", new_request_to_body_url(:url_name => @public_body.url_name)%> to <%= h(@public_body.name) %>
+
<% else %>
- <%= link_to make + " a new Freedom of Information request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= _('<a href="%s">Make a new Freedom of Information request</a> to {{public_body_name}}',
+ :public_body_name => h(@public_body.name)) % new_request_to_body_url(:url_name => @public_body.url_name)%>
<% end %>
- to <%= h(@public_body.name) %>
<% elsif @public_body.has_notes? %>
<%= @public_body.notes_as_html %>
<% elsif @public_body.not_requestable_reason == 'not_apply' %>
- Freedom of Information law does not apply to this authority, so you cannot make
- a request to it.
+ <%= _('Freedom of Information law does not apply to this authority, so you cannot make
+ a request to it.')%>
<% elsif @public_body.not_requestable_reason == 'defunct' %>
- This authority no longer exists, so you cannot make a request to it.
+ <%= _('This authority no longer exists, so you cannot make a request to it.')%>
<% else %>
- For an unknown reason, it is not possible to make a request to this authority.
+ <%= _('For an unknown reason, it is not possible to make a request to this authority.')%>
<% end %>
</strong>
</div>
<% if !@xapian_requests.nil? %>
- <% if @xapian_requests.results.empty? %>
+ <% if @xapian_requests.results.empty? %>
<% if @public_body.eir_only? %>
<h2>Environmental Information Regulations requests made using this site</h2>
+ <h4>XXX this section needs localising re EIR as these are specific to UK law</h4>
<p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p>
<% else %>
- <h2>Freedom of Information requests made using this site</h2>
- <p>Nobody has made any Freedom of Information requests to <%=h(@public_body.name)%> using this site yet.</p>
+ <h2> <%= _('Freedom of Information requests made using this site')%></h2>
+ <p> <%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p>
<% end %>
<% else %>
<h2>
<% if @public_body.eir_only? %>
<%=pluralize(@public_body.info_requests.size, "Environmental Information Regulations request") %> made using this site
<% else %>
- <%=pluralize(@public_body.info_requests.size, "Freedom of Information request") %> made using this site
+ <%= n_('Freedom of Information request', 'Freedom if Information requests', @public_body.info_requests.size) %> made using this site
<% end %>
<%= @page_desc %>
</h2>
@@ -91,15 +89,15 @@
<%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>
- <p>Only requests made using WhatDoTheyKnow.com are shown.</p>
+ <p> <%= _('Only requests made using {{site_name}} are shown.', site_name => @site_name) %></p>
<% end %>
<% else %>
<% if @public_body.eir_only? %>
<h2>Environmental Information Regulations requests made</h2>
<% else %>
- <h2>Freedom of Information requests made</h2>
+ <h2> <%= _('Freedom of Information requests made')%></h2>
<% end %>
- <p>The search index is currently offline, so we can't show the Freedom of Information requests that have been made to this authority.</p>
+ <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index edb2c7c5f..008f9bfe4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -111,6 +111,7 @@ ActionController::Routing::Routes.draw do |map|
help.help_unhappy '/help/unhappy/:url_title', :action => 'unhappy'
help.help_about '/help/about', :action => 'about'
help.help_contact '/help/contact', :action => 'contact'
+ help.help_requesting '/help/requesting', :action => 'requesting'
help.help_general '/help/:action', :action => :action
end