aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_controller.rb12
-rw-r--r--app/controllers/admin_public_body_controller.rb67
-rw-r--r--app/controllers/application_controller.rb5
-rw-r--r--app/controllers/comment_controller.rb13
-rw-r--r--app/controllers/general_controller.rb56
-rw-r--r--app/controllers/help_controller.rb2
-rw-r--r--app/controllers/public_body_controller.rb9
-rw-r--r--app/controllers/request_controller.rb113
-rw-r--r--app/controllers/request_game_controller.rb10
-rw-r--r--app/controllers/track_controller.rb20
-rw-r--r--app/controllers/user_controller.rb52
-rw-r--r--app/helpers/application_helper.rb5
-rwxr-xr-x[-rw-r--r--]app/helpers/link_to_helper.rb4
-rw-r--r--app/models/about_me_validator.rb2
-rw-r--r--app/models/application_mailer.rb4
-rw-r--r--app/models/change_email_validator.rb8
-rw-r--r--app/models/comment.rb4
-rw-r--r--app/models/contact_validator.rb2
-rw-r--r--app/models/info_request.rb47
-rw-r--r--app/models/info_request_event.rb38
-rw-r--r--app/models/outgoing_message.rb8
-rw-r--r--app/models/public_body.rb50
-rw-r--r--app/models/track_thing.rb16
-rw-r--r--app/models/user.rb16
-rw-r--r--app/models/user_mailer.rb4
-rw-r--r--app/views/admin_general/stats.rhtml3
-rw-r--r--app/views/comment/_comment_form.rhtml4
-rw-r--r--app/views/comment/_single_comment.rhtml5
-rw-r--r--app/views/comment/new.rhtml38
-rw-r--r--app/views/comment/preview.rhtml10
-rw-r--r--app/views/contact_mailer/message.rhtml6
-rw-r--r--app/views/contact_mailer/user_message.rhtml6
-rw-r--r--app/views/general/_before_body_end.rhtml17
-rw-r--r--app/views/general/_credits.rhtml6
-rw-r--r--app/views/general/_locale_switcher.rhtml23
-rw-r--r--app/views/general/_orglink.rhtml2
-rw-r--r--app/views/general/blog.rhtml68
-rw-r--r--app/views/general/exception_caught.rhtml17
-rw-r--r--app/views/general/frontpage.rhtml14
-rw-r--r--app/views/help/about.rhtml18
-rw-r--r--app/views/help/requesting.rhtml8
-rw-r--r--app/views/layouts/default.rhtml19
-rw-r--r--app/views/outgoing_mailer/_followup_footer.rhtml4
-rw-r--r--app/views/outgoing_mailer/followup.rhtml7
-rw-r--r--app/views/outgoing_mailer/initial_request.rhtml10
-rw-r--r--app/views/public_body/_body_listing.rhtml2
-rw-r--r--app/views/public_body/_body_listing_single.rhtml2
-rw-r--r--app/views/public_body/list.rhtml14
-rw-r--r--app/views/public_body/show.rhtml19
-rw-r--r--app/views/public_body/view_email.rhtml17
-rw-r--r--app/views/public_body/view_email_captcha.rhtml11
-rw-r--r--app/views/request/_after_actions.rhtml24
-rw-r--r--app/views/request/_correspondence.rhtml8
-rw-r--r--app/views/request/_describe_state.rhtml51
-rw-r--r--app/views/request/_followup.rhtml56
-rw-r--r--app/views/request/_hidden_correspondence.rhtml22
-rw-r--r--app/views/request/_other_describe_state.rhtml28
-rw-r--r--app/views/request/_request_listing.rhtml2
-rw-r--r--app/views/request/_request_listing_short_via_event.rhtml5
-rw-r--r--app/views/request/_request_listing_single.rhtml4
-rw-r--r--app/views/request/_request_listing_via_event.rhtml19
-rw-r--r--app/views/request/_sidebar.rhtml12
-rw-r--r--app/views/request/_sidebar_request_listing.rhtml2
-rw-r--r--app/views/request/_view_html_prefix.rhtml4
-rw-r--r--app/views/request/details.rhtml30
-rw-r--r--app/views/request/followup_bad.rhtml21
-rw-r--r--app/views/request/followup_preview.rhtml22
-rw-r--r--app/views/request/hidden.rhtml13
-rw-r--r--app/views/request/list.rhtml10
-rw-r--r--app/views/request/new.rhtml103
-rw-r--r--app/views/request/new_bad_contact.rhtml8
-rw-r--r--app/views/request/new_please_describe.rhtml14
-rw-r--r--app/views/request/preview.rhtml22
-rw-r--r--app/views/request/show.rhtml113
-rw-r--r--app/views/request/show_response.rhtml44
-rw-r--r--app/views/request/similar.rhtml4
-rw-r--r--app/views/request/upload_response.rhtml26
-rw-r--r--app/views/request_game/play.rhtml22
-rw-r--r--app/views/request_mailer/comment_on_alert.rhtml6
-rw-r--r--app/views/request_mailer/comment_on_alert_plural.rhtml7
-rw-r--r--app/views/request_mailer/new_response.rhtml16
-rw-r--r--app/views/request_mailer/new_response_reminder_alert.rhtml7
-rw-r--r--app/views/request_mailer/not_clarified_alert.rhtml11
-rw-r--r--app/views/request_mailer/old_unclassified_updated.rhtml13
-rw-r--r--app/views/request_mailer/overdue_alert.rhtml10
-rw-r--r--app/views/request_mailer/requires_admin.rhtml8
-rw-r--r--app/views/request_mailer/stopped_responses.rhtml26
-rw-r--r--app/views/request_mailer/very_overdue_alert.rhtml15
-rw-r--r--app/views/track/_tracking_links.rhtml2
-rw-r--r--app/views/track_mailer/event_digest.rhtml8
-rw-r--r--app/views/user/_signin.rhtml14
-rw-r--r--app/views/user/_signup.rhtml23
-rw-r--r--app/views/user/_user_listing_single.rhtml6
-rw-r--r--app/views/user/bad_token.rhtml12
-rw-r--r--app/views/user/banned.rhtml8
-rw-r--r--app/views/user/confirm.rhtml8
-rw-r--r--app/views/user/contact.rhtml8
-rw-r--r--app/views/user/no_cookies.rhtml23
-rw-r--r--app/views/user/set_crop_profile_photo.rhtml8
-rw-r--r--app/views/user/set_draft_profile_photo.rhtml14
-rw-r--r--app/views/user/set_profile_about_me.rhtml20
-rw-r--r--app/views/user/show.rhtml76
-rw-r--r--app/views/user/sign.rhtml10
-rw-r--r--app/views/user/signchangeemail.rhtml16
-rw-r--r--app/views/user/signchangeemail_confirm.rhtml10
-rw-r--r--app/views/user/signchangepassword.rhtml10
-rw-r--r--app/views/user/signchangepassword_confirm.rhtml10
-rw-r--r--app/views/user/signchangepassword_send_confirm.rhtml12
-rw-r--r--app/views/user/wrong_user.rhtml4
-rw-r--r--app/views/user/wrong_user_unknown_email.rhtml6
-rw-r--r--app/views/user_mailer/already_registered.rhtml6
-rw-r--r--app/views/user_mailer/changeemail_already_used.rhtml12
-rw-r--r--app/views/user_mailer/changeemail_confirm.rhtml10
-rw-r--r--app/views/user_mailer/confirm_login.rhtml8
114 files changed, 1054 insertions, 1015 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 004d460c5..8598091d9 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -10,7 +10,7 @@ require 'fileutils'
class AdminController < ApplicationController
layout "admin"
- before_filter :assign_http_auth_user
+ before_filter :authenticate
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# action to take if expecting an authenticity token and one isn't received
@@ -44,5 +44,15 @@ class AdminController < ApplicationController
expire_for_request(info_request)
end
end
+ private
+ def authenticate
+ username = MySociety::Config.get('ADMIN_USERNAME', '')
+ password = MySociety::Config.get('ADMIN_PASSWORD', '')
+ if !(username && password).empty?
+ authenticate_or_request_with_http_basic do |user_name, password|
+ user_name == username && password == password
+ end
+ end
+ end
end
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index 4b212c24b..f88b25572 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -9,50 +9,49 @@
class AdminPublicBodyController < AdminController
def index
list
+ render :action => 'list'
end
def _lookup_query_internal
- @query = params[:query]
- if @query == ""
- @query = nil
- end
- @page = params[:page]
- if @page == ""
- @page = nil
+ @locale = self.locale_from_params()
+ PublicBody.with_locale(@locale) do
+ @query = params[:query]
+ if @query == ""
+ @query = nil
+ end
+ @page = params[:page]
+ if @page == ""
+ @page = nil
+ end
+ @public_bodies = PublicBody.paginate :order => "public_body_translations.name", :page => @page, :per_page => 100,
+ :conditions => @query.nil? ? "public_body_translations.locale = '#{@locale}'" :
+ ["(lower(public_body_translations.name) like lower('%'||?||'%') or
+ lower(public_body_translations.short_name) like lower('%'||?||'%') or
+ lower(public_body_translations.request_email) like lower('%'||?||'%' )) AND (public_body_translations.locale = '#{@locale}')", @query, @query, @query],
+ :joins => :translations
+ @public_bodies_by_tag = PublicBody::Translation.find_by_tag(@query)
end
- @public_bodies = PublicBody.paginate :order => "name", :page => @page, :per_page => 100,
- :conditions => @query.nil? ? nil : ["lower(name) like lower('%'||?||'%') or
- lower(short_name) like lower('%'||?||'%') or
- lower(request_email) like lower('%'||?||'%')", @query, @query, @query]
- @public_bodies_by_tag = PublicBody.find_by_tag(@query)
end
def list
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
- self._lookup_query_internal
- render :action => 'list'
- end
+ self._lookup_query_internal
end
def mass_tag_add
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
- self._lookup_query_internal
-
- if params[:new_tag] and params[:new_tag] != ""
- if params[:table_name] == 'exact'
- bodies = @public_bodies_by_tag
- elsif params[:table_name] == 'substring'
- bodies = @public_bodies
- else
- raise "Unknown table_name " + params[:table_name]
- end
- for body in bodies
- body.add_tag_if_not_already_present(params[:new_tag])
- end
- flash[:notice] = "Added tag to table of bodies."
- end
+ self._lookup_query_internal
+
+ if params[:new_tag] and params[:new_tag] != ""
+ if params[:table_name] == 'exact'
+ bodies = @public_bodies_by_tag
+ elsif params[:table_name] == 'substring'
+ bodies = @public_bodies
+ else
+ raise "Unknown table_name " + params[:table_name]
+ end
+ for body in bodies
+ body.add_tag_if_not_already_present(params[:new_tag])
+ end
+ flash[:notice] = "Added tag to table of bodies."
end
redirect_to admin_url('body/list') + "?query=" + @query + (@page.nil? ? "" : "&page=" + @page) # XXX construct this URL properly
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e39865dd9..405327952 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -29,9 +29,8 @@ class ApplicationController < ActionController::Base
helper_method :site_name, :locale_from_params
def site_name
- # XXX should come from database:
- site_name = "WhatDoTheyKnow"
- return site_name
+ site_name = MySociety::Config.get('SITE_NAME', 'Alaveteli')
+ return site_name
end
# Help work out which request causes RAM spike.
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index 4a0661f34..86d5b0a06 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -52,14 +52,15 @@ class CommentController < ApplicationController
end
if authenticated?(
- :web => "To post your annotation",
- :email => "Then your annotation to " + @info_request.title + " will be posted.",
- :email_subject => "Confirm your annotation to " + @info_request.title
+ :web => _("To post your annotation"),
+ :email => _("Then your annotation to {{info_request_title}} will be posted.",:info_request_title=>@info_request.title),
+ :email_subject => _("Confirm your annotation to {{info_request_title}}",:info_request_title=>@info_request.title)
)
# Also subscribe to track for this request, so they get updates
# (do this first, so definitely don't send alert)
- flash[:notice] = "Thank you for making an annotation!"
+ flash[:notice] = _("Thank you for making an annotation!")
+
if params[:subscribe_to_request]
@track_thing = TrackThing.create_track_for_request(@info_request)
@existing_track = TrackThing.find_by_existing_track(@user, @track_thing)
@@ -69,9 +70,9 @@ class CommentController < ApplicationController
@track_thing.track_medium = 'email_daily'
@track_thing.tracking_user_id = @user.id
@track_thing.save!
- flash[:notice] += " You will also be emailed updates about the request."
+ flash[:notice] += _(" You will also be emailed updates about the request.")
else
- flash[:notice] += " You are already being emailed updates about the request."
+ flash[:notice] += _(" You are already being emailed updates about the request.")
end
end
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 47962d60a..6e5c8c3fd 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -20,23 +20,36 @@ class GeneralController < ApplicationController
# New, improved front page!
def frontpage
+
behavior_cache do
# get some example searches and public bodies to display
# either from config, or based on a (slow!) query if not set
body_short_names = MySociety::Config.get('FRONTPAGE_PUBLICBODY_EXAMPLES', '').split(/\s*;\s*/).map{|s| "'%s'" % s.gsub(/'/, "''") }.join(", ")
- if body_short_names.empty?
- # This is too slow
- @popular_bodies = PublicBody.find(:all, :select => "*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", :order => "c desc", :limit => 32)
- else
- @popular_bodies = PublicBody.find(:all, :conditions => ["url_name in (" + body_short_names + ")"])
+ @locale = self.locale_from_params()
+ locale_condition = 'public_body_translations.locale = ?'
+ conditions = [locale_condition, @locale]
+ PublicBody.with_locale(@locale) do
+ if body_short_names.empty?
+ # This is too slow
+ @popular_bodies = PublicBody.find(:all,
+ :select => "public_bodies.*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c",
+ :order => "c desc",
+ :limit => 32,
+ :conditions => conditions,
+ :joins => :translations
+ )
+ else
+ conditions[0] += " and public_bodies.url_name in (" + body_short_names + ")"
+ @popular_bodies = PublicBody.find(:all,
+ :conditions => conditions,
+ :joins => :translations)
+ end
end
@search_examples = MySociety::Config.get('FRONTPAGE_SEARCH_EXAMPLES', '').split(/\s*;\s*/)
if @search_examples.empty?
@search_examples = @popular_bodies.map { |body| body.name }
end
-
-
# Get some successful requests #
begin
query = 'variety:response (status:successful OR status:partially_successful)'
@@ -53,23 +66,18 @@ class GeneralController < ApplicationController
# Display WhatDoTheyKnow category from mySociety blog
def blog
- feed_url = 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/'
- content = open(feed_url).read
- @data = XmlSimple.xml_in(content)
- @channel = @data['channel'][0]
- @items = @channel['item']
-
- @feed_autodetect = [ { :url => feed_url, :title => "WhatDoTheyKnow blog"} ]
-
- twitter_url = 'http://api.twitter.com/1/statuses/user_timeline/whatdotheyknow.rss' # @whatdotheyknow
- content = open(twitter_url).read
- @data = XmlSimple.xml_in(content)
- @channel = @data['channel'][0]
- @items = @channel['item'] + @items
-
- @feed_autodetect += [ { :url => twitter_url, :title => "WhatDoTheyKnow tweets"} ]
-
- @items.sort! { |a,b| Time.parse(b['pubDate'][0]) <=> Time.parse(a['pubDate'][0]) }
+ @feed_autodetect = []
+ feed_url = MySociety::Config.get('BLOG_FEED', '')
+ if not feed_url.empty?
+ content = open(feed_url).read
+ @data = XmlSimple.xml_in(content)
+ @channel = @data['channel'][0]
+ @blog_items = @channel['item']
+ @feed_autodetect = [ { :url => feed_url, :title => "WhatDoTheyKnow blog"} ]
+ else
+ @blog_items = []
+ end
+ @twitter_user = MySociety::Config.get('TWITTER_USERNAME', '')
end
# Just does a redirect from ?query= search to /query
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index 5df701543..ab1ef5c5f 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -58,7 +58,7 @@ class HelpController < ApplicationController
@user,
@last_request, @last_body
)
- flash[:notice] = "Your message has been sent. Thank you for getting in touch! We'll get back to you soon."
+ flash[:notice] = _("Your message has been sent. Thank you for getting in touch! We'll get back to you soon.")
redirect_to frontpage_url
return
end
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 4e5bf8ad7..c74959b17 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -20,7 +20,10 @@ class PublicBodyController < ApplicationController
PublicBody.with_locale(@locale) do
@public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
raise "None found" if @public_body.nil? # XXX proper 404
-
+ if @public_body.url_name.nil?
+ redirect_to :back
+ return
+ end
# If found by historic name, or alternate locale name, redirect to new name
if @public_body.url_name != params[:url_name]
redirect_to show_public_body_url(:url_name => @public_body.url_name)
@@ -70,7 +73,7 @@ class PublicBodyController < ApplicationController
render :template => "public_body/view_email"
return
end
- flash.now[:error] = "There was an error with the words you entered, please try again."
+ flash.now[:error] = _("There was an error with the words you entered, please try again.")
end
render :template => "public_body/view_email_captcha"
end
@@ -103,7 +106,7 @@ class PublicBodyController < ApplicationController
and has_tag_string_tags.name = ?) > 0', @locale, @tag]
end
if @tag.size == 1
- @description = "beginning with '" + @tag + "'"
+ @description = _("beginning with") + " '" + @tag + "'"
else
@description = PublicBodyCategories::CATEGORIES_BY_TAG[@tag]
if @description.nil?
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 578e247d1..b17717002 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -46,9 +46,9 @@ class RequestController < ApplicationController
if @update_status
return if !@is_owning_user && !authenticated_as_user?(@info_request.user,
- :web => "To update the status of this FOI request",
- :email => "Then you can update the status of your request to " + @info_request.public_body.name + ".",
- :email_subject => "Update the status of your request to " + @info_request.public_body.name
+ :web => _("To update the status of this FOI request"),
+ :email => _("Then you can update the status of your request to ") + @info_request.public_body.name + ".",
+ :email_subject => _("Update the status of your request to ") + @info_request.public_body.name
)
end
@@ -121,12 +121,12 @@ class RequestController < ApplicationController
end
if @view == 'recent'
- @title = "Recently sent Freedom of Information requests"
+ @title = _("Recently sent Freedom of Information requests")
query = "variety:sent";
sortby = "newest"
@track_thing = TrackThing.create_track_for_all_new_requests
elsif @view == 'successful'
- @title = "Recently successful responses"
+ @title = _("Recently successful responses")
query = 'variety:response (status:successful OR status:partially_successful)'
sortby = "described"
@track_thing = TrackThing.create_track_for_all_successful_requests
@@ -262,15 +262,15 @@ class RequestController < ApplicationController
message = ""
if @outgoing_message.contains_email?
if @user.nil?
- message += "<p>You do not need to include your email in the request in order to get a reply, as we will ask for it on the next screen (<a href=\"/help/privacy#email_address\">details</a>).</p>";
+ message += _("<p>You do not need to include your email in the request in order to get a reply, as we will ask for it on the next screen (<a href=\"%s\">details</a>).</p>") % [help_privacy_path+"#email_address"];
else
- message += "<p>You do not need to include your email in the request in order to get a reply (<a href=\"/help/privacy#email_address\">details</a>).</p>";
+ message += _("<p>You do not need to include your email in the request in order to get a reply (<a href=\"%s\">details</a>).</p>") % [help_privacy_path+"#email_address"];
end
- message += "<p>We recommend that you edit your request and remove the email address.
- If you leave it, the email address will be sent to the authority, but will not be displayed on the site.</p>"
+ message += _("<p>We recommend that you edit your request and remove the email address.
+ If you leave it, the email address will be sent to the authority, but will not be displayed on the site.</p>")
end
if @outgoing_message.contains_postcode?
- message += "<p>Your request contains a <strong>postcode</strong>. Unless it directly relates to the subject of your request, please remove any address as it will <strong>appear publicly on the Internet</strong>.</p>";
+ message += _("<p>Your request contains a <strong>postcode</strong>. Unless it directly relates to the subject of your request, please remove any address as it will <strong>appear publicly on the Internet</strong>.</p>");
end
if not message.empty?
flash.now[:error] = message
@@ -280,9 +280,9 @@ class RequestController < ApplicationController
end
if !authenticated?(
- :web => "To send your FOI request",
- :email => "Then your FOI request to " + @info_request.public_body.name + " will be sent.",
- :email_subject => "Confirm your FOI request to " + @info_request.public_body.name
+ :web => _("To send your FOI request"),
+ :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name),
+ :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name
)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
@@ -293,11 +293,11 @@ class RequestController < ApplicationController
@info_request.save!
# XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here.
@outgoing_message.send_message
- flash[:notice] = "<p>Your " + @info_request.law_used_full + " request has been <strong>sent on its way</strong>!</p>
+ flash[:notice] = _("<p>Your {{law_used_full}} request has been <strong>sent on its way</strong>!</p>
<p><strong>We will email you</strong> when there is a response, or after 20 working days if the authority still hasn't
replied by then.</p>
<p>If you write about this request (for example in a forum or a blog) please link to this page, and add an
- annotation below telling people about your writing.</p>"
+ annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full)
redirect_to request_url(@info_request)
end
@@ -319,22 +319,22 @@ class RequestController < ApplicationController
# Check authenticated, and parameters set. We check is_owning_user
# to get admin overrides (see is_owning_user? above)
if !@old_unclassified && !@is_owning_user && !authenticated_as_user?(@info_request.user,
- :web => "To classify the response to this FOI request",
- :email => "Then you can classify the FOI response you have got from " + @info_request.public_body.name + ".",
- :email_subject => "Classify an FOI response from " + @info_request.public_body.name
+ :web => _("To classify the response to this FOI request"),
+ :email => _("Then you can classify the FOI response you have got from ") + @info_request.public_body.name + ".",
+ :email_subject => _("Classify an FOI response from ") + @info_request.public_body.name
)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
end
if !params[:incoming_message]
- flash[:error] = "Please choose whether or not you got some of the information that you wanted."
+ flash[:error] = _("Please choose whether or not you got some of the information that you wanted.")
redirect_to request_url(@info_request)
return
end
if params[:last_info_request_event_id].to_i != @last_info_request_event_id
- flash[:error] = "The request has been updated since you originally loaded this page. Please check for any new incoming messages below, and try again."
+ flash[:error] = _("The request has been updated since you originally loaded this page. Please check for any new incoming messages below, and try again.")
redirect_to request_url(@info_request)
return
end
@@ -360,10 +360,10 @@ class RequestController < ApplicationController
# Don't give advice on what to do next, as it isn't their request
RequestMailer.deliver_old_unclassified_updated(@info_request)
if session[:request_game]
- flash[:notice] = 'Thank you for updating the status of the request \'<a href="' + CGI.escapeHTML(request_url(@info_request)) + '">' + CGI.escapeHTML(@info_request.title) + '</a>\'. There are some more requests below for you to classify.'
+ flash[:notice] = _('Thank you for updating the status of the request \'<a href="%s">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(@info_request.title)) % [CGI.escapeHTML(request_url(@info_request))]
redirect_to play_url
else
- flash[:notice] = 'Thank you for updating this request!'
+ flash[:notice] = _('Thank you for updating this request!')
redirect_to request_url(@info_request)
end
return
@@ -371,52 +371,59 @@ class RequestController < ApplicationController
# Display advice for requester on what to do next, as appropriate
if @info_request.calculate_status == 'waiting_response'
- flash[:notice] = "<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and " + (@info_request.public_body.is_school? ? "in term time" : "") + " normally before the end of <strong>" + simple_date(@info_request.date_response_required_by) + "</strong>.</p>"
+ flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>
+{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'waiting_response_overdue'
- flash[:notice] = "<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and " + (@info_request.public_body.is_school? ? "in term time" : "") + " normally before the end of <strong>" + simple_date(@info_request.date_response_required_by) + "</strong>.</p>"
+ flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'waiting_response_very_overdue'
- flash[:notice] = "<p>Thank you! Your request is long overdue, by more than 40 working days. Most requests should be answered within 20 working days. You might like to complain about this, see below.</p>"
+ flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than 40 working days. Most requests should be answered within 20 working days. You might like to complain about this, see below.</p>")
redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'not_held'
- flash[:notice] = "<p>Thank you! Here are some ideas on what to do next:</p>
+ flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p>
<ul>
- <li>To send your request to another authority, first copy the text of your request below, then <a href=\"/new\">find the other authority</a>.</li>
+ <li>To send your request to another authority, first copy the text of your request below, then <a href=\"%s\">find the other authority</a>.</li>
<li>If you would like to contest the authority's claim that they do not hold the information, here is
- <a href=\"" + CGI.escapeHTML(unhappy_url(@info_request)) + "\">how to complain</a>.
+ <a href=\"%s\">how to complain</a>.
</li>
- <li>We have <a href=\"" + CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means\">suggestions</a>
+ <li>We have <a href=\"%s\">suggestions</a>
on other means to answer your question.
</li>
</ul>
- "
+ ") % ["/new",CGI.escapeHTML(unhappy_url(@info_request)),CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means"]
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'rejected'
- flash[:notice] = "Oh no! Sorry to hear that your request was refused. Here is what to do now."
+ flash[:notice] = _("Oh no! Sorry to hear that your request was refused. Here is what to do now.")
redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'successful'
- flash[:notice] = "<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found WhatDoTheyKnow useful, <a href=\"http://www.mysociety.org/donate/\">make a donation</a> to the charity which runs it.</p>"
+ flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found WhatDoTheyKnow useful, <a href=\"%s\">make a donation</a> to the charity which runs it.</p>") % ["http://www.mysociety.org/donate/"]
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'partially_successful'
- flash[:notice] = "<p>We're glad you got some of the information that you wanted. If you found WhatDoTheyKnow useful, <a href=\"http://www.mysociety.org/donate/\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>"
+ flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found WhatDoTheyKnow useful, <a href=\"%s\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>") % ["http://www.mysociety.org/donate/"]
redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'waiting_clarification'
- flash[:notice] = "Please write your follow up message containing the necessary clarifications below."
+ flash[:notice] = _("Please write your follow up message containing the necessary clarifications below.")
redirect_to respond_to_last_url(@info_request)
elsif @info_request.calculate_status == 'gone_postal'
redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
+ elsif @info_request.calculate_status == 'deadline_extended'
+ flash[:notice] = _("Authority has requested extension of the deadline.")
+ redirect_to unhappy_url(@info_request)
+ elsif @info_request.calculate_status == 'wrong_response'
+ flash[:notice] = _("Oh no! Sorry to hear that your request was wrong. Here is what to do now.")
+ redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'internal_review'
- flash[:notice] = "<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within 20 days, or be told if it will take longer (<a href=\"" + unhappy_url(@info_request) + "#internal_review\">details</a>).</p>"
+ flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within 20 days, or be told if it will take longer (<a href=\"%s\">details</a>).</p>") % [unhappy_url(@info_request) + "#internal_review"]
redirect_to request_url(@info_request)
elsif @info_request.calculate_status == 'error_message'
- flash[:notice] = "<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>"
+ flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>")
redirect_to help_general_url(:action => 'contact')
elsif @info_request.calculate_status == 'requires_admin'
- flash[:notice] = "Please use the form below to tell us more."
+ flash[:notice] = _("Please use the form below to tell us more.")
redirect_to help_general_url(:action => 'contact')
elsif @info_request.calculate_status == 'user_withdrawn'
- flash[:notice] = "If you have not done so already, please write a message below telling the authority that you have withdrawn your request. Otherwise they will not know it has been withdrawn."
+ flash[:notice] = _("If you have not done so already, please write a message below telling the authority that you have withdrawn your request. Otherwise they will not know it has been withdrawn.")
redirect_to respond_to_last_url(@info_request)
else
raise "unknown calculate_status " + @info_request.calculate_status
@@ -517,24 +524,24 @@ class RequestController < ApplicationController
# message and wasting their time if they are not the requester.
if !authenticated_as_user?(@info_request.user,
:web => @incoming_message.nil? ?
- "To send a follow up message to " + @info_request.public_body.name :
- "To reply to " + @info_request.public_body.name,
+ _("To send a follow up message to ") + @info_request.public_body.name :
+ _("To reply to ") + @info_request.public_body.name,
:email => @incoming_message.nil? ?
- "Then you can write follow up message to " + @info_request.public_body.name + "." :
- "Then you can write your reply to " + @info_request.public_body.name + ".",
+ _("Then you can write follow up message to ") + @info_request.public_body.name + "." :
+ _("Then you can write your reply to ") + @info_request.public_body.name + ".",
:email_subject => @incoming_message.nil? ?
- "Write your FOI follow up message to " + @info_request.public_body.name :
- "Write a reply to " + @info_request.public_body.name
+ _("Write your FOI follow up message to ") + @info_request.public_body.name :
+ _("Write a reply to ") + @info_request.public_body.name
)
return
end
if !params[:submitted_followup].nil? && !params[:reedit]
if @info_request.allow_new_responses_from == 'nobody'
- flash[:error] = 'Your follow up has not been sent because this request has been stopped to prevent spam. Please <a href="/help/contact">contact us</a> if you really want to send a follow up message.'
+ flash[:error] = _('Your follow up has not been sent because this request has been stopped to prevent spam. Please <a href="%s">contact us</a> if you really want to send a follow up message.') % [help_contact_path]
else
if @info_request.find_existing_outgoing_message(params[:outgoing_message][:body])
- flash[:error] = 'You previously submitted that exact follow up message for this request.'
+ flash[:error] = _('You previously submitted that exact follow up message for this request.')
render :action => 'show_response'
return
end
@@ -557,9 +564,9 @@ class RequestController < ApplicationController
@outgoing_message.send_message
@outgoing_message.save!
if @outgoing_message.what_doing == 'internal_review'
- flash[:notice] = "Your internal review request has been sent on its way."
+ flash[:notice] = _("Your internal review request has been sent on its way.")
else
- flash[:notice] = "Your follow up message has been sent on its way."
+ flash[:notice] = _("Your follow up message has been sent on its way.")
end
redirect_to request_url(@info_request)
end
@@ -676,9 +683,9 @@ class RequestController < ApplicationController
@info_request = InfoRequest.find_by_url_title(params[:url_title])
@reason_params = {
- :web => "To upload a response, you must be logged in using an email address from " + CGI.escapeHTML(@info_request.public_body.name),
- :email => "Then you can upload an FOI response. ",
- :email_subject => "Confirm your account on WhatDoTheyKnow.com"
+ :web => _("To upload a response, you must be logged in using an email address from ") + CGI.escapeHTML(@info_request.public_body.name),
+ :email => _("Then you can upload an FOI response. "),
+ :email_subject => _("Confirm your account on {{site_name}}",:site_name=>site_name)
}
if !authenticated?(@reason_params)
return
@@ -705,13 +712,13 @@ class RequestController < ApplicationController
body = params[:body] || ""
if file_name.nil? && body.empty?
- flash[:error] = "Please type a message and/or choose a file containing your response."
+ flash[:error] = _("Please type a message and/or choose a file containing your response.")
return
end
mail = RequestMailer.create_fake_response(@info_request, @user, body, file_name, file_content)
@info_request.receive(mail, mail.encoded, true)
- flash[:notice] = "Thank you for responding to this FOI request! Your response has been published below, and a link to your response has been emailed to " + CGI.escapeHTML(@info_request.user.name) + "."
+ flash[:notice] = _("Thank you for responding to this FOI request! Your response has been published below, and a link to your response has been emailed to ") + CGI.escapeHTML(@info_request.user.name) + "."
redirect_to request_url(@info_request)
return
end
diff --git a/app/controllers/request_game_controller.rb b/app/controllers/request_game_controller.rb
index 0d70a2e03..b9440a906 100644
--- a/app/controllers/request_game_controller.rb
+++ b/app/controllers/request_game_controller.rb
@@ -20,7 +20,7 @@ class RequestGameController < ApplicationController
@requests = old.sort_by{ rand }.slice(0..2)
if @missing == 0
- flash[:notice] = '<p>All done! Thank you very much for your help.</p><p>There are <a href="/help/credits#helpus">more things you can do</a> to help WhatDoTheyKnow.</p>'
+ flash[:notice] = _('<p>All done! Thank you very much for your help.</p><p>There are <a href="%s">more things you can do</a> to help WhatDoTheyKnow.</p>') % [help_credits_path+"#helpus"]
end
@league_table_28_days = InfoRequestEvent.make_league_table(
@@ -35,9 +35,9 @@ class RequestGameController < ApplicationController
def show
url_title = params[:url_title]
if !authenticated?(
- :web => "To play the request categorisation game",
- :email => "Then you can play the request categorisation game.",
- :email_subject => "Play the request categorisation game"
+ :web => _("To play the request categorisation game"),
+ :email => _("Then you can play the request categorisation game."),
+ :email_subject => _("Play the request categorisation game")
)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
@@ -47,7 +47,7 @@ class RequestGameController < ApplicationController
def stop
session[:request_game] = nil
- flash[:notice] = 'Thank you for helping us keep the site tidy!'
+ flash[:notice] = _('Thank you for helping us keep the site tidy!')
redirect_to frontpage_url
end
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index e262db099..10b3418bd 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -93,7 +93,7 @@ class TrackController < ApplicationController
if @user
@existing_track = TrackThing.find_by_existing_track(@user, @track_thing)
if @existing_track
- flash[:notice] = "You are already being emailed updates about " + @track_thing.params[:list_description]
+ flash[:notice] = _("You are already being emailed updates about ") + @track_thing.params[:list_description]
return true
end
end
@@ -106,7 +106,7 @@ class TrackController < ApplicationController
@track_thing.tracking_user_id = @user.id
@track_thing.save!
- flash[:notice] = "You will now be emailed updates about " + @track_thing.params[:list_description]
+ flash[:notice] = _("You will now be emailed updates about ") + @track_thing.params[:list_description]
return true
end
@@ -138,9 +138,9 @@ class TrackController < ApplicationController
track_thing = TrackThing.find(params[:track_id].to_i)
if not authenticated_as_user?(track_thing.tracking_user,
- :web => "To cancel this alert",
- :email => "Then you can cancel the alert.",
- :email_subject => "Cancel a WhatDoTheyKnow alert"
+ :web => _("To cancel this alert"),
+ :email => _("Then you can cancel the alert."),
+ :email_subject => _("Cancel a {{site_name}} alert",:site_name=>site_name)
)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
@@ -149,7 +149,7 @@ class TrackController < ApplicationController
new_medium = params[:track_medium]
if new_medium == 'delete'
track_thing.destroy
- flash[:notice] = "You will no longer be emailed updates about " + track_thing.params[:list_description]
+ flash[:notice] = _("You will no longer be emailed updates about ") + track_thing.params[:list_description]
redirect_to params[:r]
# Reuse code like this if we let medium change again.
#elsif new_medium == 'email_daily'
@@ -168,9 +168,9 @@ class TrackController < ApplicationController
user_id = User.find(params[:user].to_i)
if not authenticated_as_user?(user_id,
- :web => "To cancel these alerts",
- :email => "Then you can cancel the alerts.",
- :email_subject => "Cancel some WhatDoTheyKnow alerts"
+ :web => _("To cancel these alerts"),
+ :email => _("Then you can cancel the alerts."),
+ :email_subject => _("Cancel some {{site_name}} alerts",:site_name=>site_name)
)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
@@ -178,7 +178,7 @@ class TrackController < ApplicationController
track_type = params[:track_type]
- flash[:notice] = "You will no longer be emailed updates for those alerts"
+ flash[:notice] = _("You will no longer be emailed updates for those alerts")
for track_thing in TrackThing.find(:all, :conditions => [ "track_type = ? and tracking_user_id = ?", track_type, user_id ])
track_thing.destroy
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index a2348bb08..2e3f6c9e0 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -185,7 +185,7 @@ class UserController < ApplicationController
if params[:submitted_signchangepassword_send_confirm]
# They've entered the email, check it is OK and user exists
if not MySociety::Validate.is_valid_email(params[:signchangepassword][:email])
- flash[:error] = "That doesn't look like a valid email address. Please check you have typed it correctly."
+ flash[:error] = _("That doesn't look like a valid email address. Please check you have typed it correctly.")
render :action => 'signchangepassword_send_confirm'
return
end
@@ -199,8 +199,8 @@ class UserController < ApplicationController
post_redirect = PostRedirect.new(:uri => url , :post_params => {},
:reason_params => {
:web => "",
- :email => "Then you can change your password on WhatDoTheyKnow.com",
- :email_subject => "Change your password on WhatDoTheyKnow.com"
+ :email => _("Then you can change your password on {{site_name}}",:site_name=>site_name),
+ :email_subject => _("Change your password {{site_name}}",:site_name=>site_name)
},
:circumstance => "change_password" # special login that lets you change your password
)
@@ -227,7 +227,7 @@ class UserController < ApplicationController
render :action => 'signchangepassword'
else
@user.save!
- flash[:notice] = "Your password has been changed."
+ flash[:notice] = _("Your password has been changed.")
if params[:pretoken] and not params[:pretoken].empty?
post_redirect = PostRedirect.find_by_token(params[:pretoken])
do_post_redirect post_redirect
@@ -244,9 +244,9 @@ class UserController < ApplicationController
# Change your email
def signchangeemail
if not authenticated?(
- :web => "To change your email address used on WhatDoTheyKnow.com",
- :email => "Then you can change your email address used on WhatDoTheyKnow.com",
- :email_subject => "Change your email address used on WhatDoTheyKnow.com"
+ :web => _("To change your email address used on {{site_name}}",:site_name=>site_name),
+ :email => _("Then you can change your email address used on {{site_name}}",:site_name=>site_name),
+ :email_subject => _("Change your email address used on {{site_name}}",:site_name=>site_name)
)
# "authenticated?" has done the redirect to signin page for us
return
@@ -306,7 +306,7 @@ class UserController < ApplicationController
# Now clear the circumstance
session[:user_circumstance] = nil
- flash[:notice] = "You have now changed your email address used on WhatDoTheyKnow.com"
+ flash[:notice] = _("You have now changed your email address used on {{site_name}}",:site_name=>site_name)
redirect_to user_url(@user)
end
@@ -325,9 +325,9 @@ class UserController < ApplicationController
# partly to avoid spam, and partly to have some equanimity of openess
# between the two users)
if not authenticated?(
- :web => "To send a message to " + CGI.escapeHTML(@recipient_user.name),
- :email => "Then you can send a message to " + @recipient_user.name + ".",
- :email_subject => "Send a message to " + @recipient_user.name
+ :web => _("To send a message to ") + CGI.escapeHTML(@recipient_user.name),
+ :email => _("Then you can send a message to ") + @recipient_user.name + ".",
+ :email_subject => _("Send a message to ") + @recipient_user.name
)
# "authenticated?" has done the redirect to signin page for us
return
@@ -345,13 +345,13 @@ class UserController < ApplicationController
params[:contact][:subject],
params[:contact][:message]
)
- flash[:notice] = "Your message to " + CGI.escapeHTML(@recipient_user.name) + " has been sent!"
+ flash[:notice] = _("Your message to {{recipient_user_name}} has been sent!",:recipient_user_name=>CGI.escapeHTML(@recipient_user.name))
redirect_to user_url(@recipient_user)
return
end
else
@contact = ContactValidator.new(
- { :message => "" + @recipient_user.name + ",\n\n\n\nYours,\n\n" + @user.name }
+ { :message => "" + @recipient_user.name + _(",\n\n\n\nYours,\n\n{{user_name}}",:user_name=>@user.name) }
)
end
@@ -367,7 +367,7 @@ class UserController < ApplicationController
def set_profile_photo
# check they are logged in (the upload photo option is anyway only available when logged in)
if authenticated_user.nil?
- flash[:error] = "You need to be logged in to change your profile photo."
+ flash[:error] = _("You need to be logged in to change your profile photo.")
redirect_to frontpage_url
return
end
@@ -394,7 +394,7 @@ class UserController < ApplicationController
@profile_photo = ProfilePhoto.new(:data => @draft_profile_photo.data, :draft => false)
@user.set_profile_photo(@profile_photo)
@draft_profile_photo.destroy
- flash[:notice] = "Thank you for updating your profile photo"
+ flash[:notice] = _("Thank you for updating your profile photo")
redirect_to user_url(@user)
return
end
@@ -410,11 +410,11 @@ class UserController < ApplicationController
draft_profile_photo.destroy
if !@user.get_about_me_for_html_display.empty?
- flash[:notice] = "Thank you for updating your profile photo"
+ flash[:notice] = _("Thank you for updating your profile photo")
redirect_to user_url(@user)
else
- flash[:notice] = "<p>Thanks for updating your profile photo.</p>
- <p><strong>Next...</strong> You can put some text about you and your research on your profile.</p>"
+ flash[:notice] = _("<p>Thanks for updating your profile photo.</p>
+ <p><strong>Next...</strong> You can put some text about you and your research on your profile.</p>")
redirect_to set_profile_about_me_url()
end
else
@@ -429,7 +429,7 @@ class UserController < ApplicationController
# check they are logged in (the upload photo option is anyway only available when logged in)
if authenticated_user.nil?
- flash[:error] = "You need to be logged in to clear your profile photo."
+ flash[:error] = _("You need to be logged in to clear your profile photo.")
redirect_to frontpage_url
return
end
@@ -438,7 +438,7 @@ class UserController < ApplicationController
@user.profile_photo.destroy
end
- flash[:notice] = "You've now cleared your profile photo"
+ flash[:notice] = _("You've now cleared your profile photo")
redirect_to user_url(@user)
end
@@ -466,7 +466,7 @@ class UserController < ApplicationController
# Change about me text on your profile page
def set_profile_about_me
if authenticated_user.nil?
- flash[:error] = "You need to be logged in to change the text about you on your profile."
+ flash[:error] = _("You need to be logged in to change the text about you on your profile.")
redirect_to frontpage_url
return
end
@@ -488,11 +488,11 @@ class UserController < ApplicationController
@user.about_me = @about_me.about_me
@user.save!
if @user.profile_photo
- flash[:notice] = "You have now changed the text about you on your profile."
+ flash[:notice] = _("You have now changed the text about you on your profile.")
redirect_to user_url(@user)
else
- flash[:notice] = "<p>Thanks for changing the text about you on your profile.</p>
- <p><strong>Next...</strong> You can upload a profile photograph too.</p>"
+ flash[:notice] = _("<p>Thanks for changing the text about you on your profile.</p>
+ <p><strong>Next...</strong> You can upload a profile photograph too.</p>")
redirect_to set_profile_photo_url()
end
end
@@ -510,8 +510,8 @@ class UserController < ApplicationController
@post_redirect = PostRedirect.new(:uri => params[:r], :post_params => {},
:reason_params => {
:web => "",
- :email => "Then you can sign in to WhatDoTheyKnow.com",
- :email_subject => "Confirm your account on WhatDoTheyKnow.com"
+ :email => _("Then you can sign in to {{site_name}}",:site_name=>site_name),
+ :email_subject => _("Confirm your account on {{site_name}}",:site_name=>site_name)
})
@post_redirect.save!
params[:token] = @post_redirect.token
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e46404a72..9bdcb98cd 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -6,6 +6,7 @@
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
# $Id: application_helper.rb,v 1.22 2008-07-09 07:24:50 francis Exp $
+require 'languages'
module ApplicationHelper
# URL generating functions are needed by all controllers (for redirects),
@@ -66,6 +67,10 @@ module ApplicationHelper
t = highlight_words(t, words, html)
return t
end
+
+ def locale_name(locale)
+ return LanguageNames::get_language_name(locale)
+ end
# Use our own algorithm for finding path of cache
def foi_cache(name = {}, options = nil, &block)
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 85913b12e..935912a61 100644..100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -162,7 +162,7 @@ module LinkToHelper
# Admin pages
def admin_url(relative_path)
- admin_url_prefix = MySociety::Config.get("ADMIN_BASE_URL", "/admin/")
+ admin_url_prefix = admin_general_index_path+"/"
return admin_url_prefix + relative_path
end
@@ -203,6 +203,6 @@ module LinkToHelper
params['locale'] = locale
return url_for(params)
end
-
+
end
diff --git a/app/models/about_me_validator.rb b/app/models/about_me_validator.rb
index f7b88f7dd..ec2b03201 100644
--- a/app/models/about_me_validator.rb
+++ b/app/models/about_me_validator.rb
@@ -21,7 +21,7 @@ class AboutMeValidator < ActiveRecord::BaseWithoutTable
def validate
if !self.about_me.blank? && self.about_me.size > 500
- errors.add(:about_me, N_("Please keep it shorter than 500 characters"))
+ errors.add(_("Please keep it shorter than 500 characters"))
end
end
diff --git a/app/models/application_mailer.rb b/app/models/application_mailer.rb
index 8ee467b60..508ff2016 100644
--- a/app/models/application_mailer.rb
+++ b/app/models/application_mailer.rb
@@ -15,7 +15,9 @@ class ApplicationMailer < ActionMailer::Base
self.raise_delivery_errors = true
def contact_from_name_and_email
- "WhatDoTheyKnow <"+MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost')+">"
+ contact_name = MySociety::Config.get("CONTACT_NAME", 'contact@localhost')
+ contact_email = MySociety::Config.get("CONTACT_EMAIL", 'Alaveteli')
+ return "#{contact_name} <#{contact_email}>"
end
def blackhole_email
diff --git a/app/models/change_email_validator.rb b/app/models/change_email_validator.rb
index 5cead4b4c..f7ec6d17e 100644
--- a/app/models/change_email_validator.rb
+++ b/app/models/change_email_validator.rb
@@ -36,21 +36,21 @@ class ChangeEmailValidator < ActiveRecord::BaseWithoutTable
def validate
if !self.old_email.blank? && !MySociety::Validate.is_valid_email(self.old_email)
- errors.add(:old_email, "Old email doesn't look like a valid address")
+ errors.add(:old_email, _("Old email doesn't look like a valid address"))
end
if !errors[:old_email]
if self.old_email.downcase != self.logged_in_user.email.downcase
- errors.add(:old_email, "Old email address isn't the same as the address of the account you are logged in with")
+ errors.add(:old_email, _("Old email address isn't the same as the address of the account you are logged in with"))
elsif (!self.changing_email) && (!self.logged_in_user.has_this_password?(self.password))
if !errors[:password]
- errors.add(:password, "Password is not correct")
+ errors.add(:password, _("Password is not correct"))
end
end
end
if !self.new_email.blank? && !MySociety::Validate.is_valid_email(self.new_email)
- errors.add(:new_email, "New email doesn't look like a valid address")
+ errors.add(:new_email, _("New email doesn't look like a valid address"))
end
end
diff --git a/app/models/comment.rb b/app/models/comment.rb
index 3d69b1108..b7ece9ba9 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -56,10 +56,10 @@ class Comment < ActiveRecord::Base
# Check have edited comment
def validate
if self.body.empty? || self.body =~ /^\s+$/
- errors.add(:body, N_("Please enter your annotation"))
+ errors.add(:body, _("Please enter your annotation"))
end
if !MySociety::Validate.uses_mixed_capitals(self.body)
- errors.add(:body, N_('Please write your annotation using a mixture of capital and lower case letters. This makes it easier for others to read.'))
+ errors.add(:body, _('Please write your annotation using a mixture of capital and lower case letters. This makes it easier for others to read.'))
end
end
diff --git a/app/models/contact_validator.rb b/app/models/contact_validator.rb
index 9d8c54095..0bc562835 100644
--- a/app/models/contact_validator.rb
+++ b/app/models/contact_validator.rb
@@ -31,7 +31,7 @@ class ContactValidator < ActiveRecord::BaseWithoutTable
validates_presence_of :message, :message => N_("Please enter the message you want to send")
def validate
- errors.add(:email, "Email doesn't look like a valid address") unless MySociety::Validate.is_valid_email(self.email)
+ errors.add(:email, _("Email doesn't look like a valid address")) unless MySociety::Validate.is_valid_email(self.email)
end
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index cab28b8f1..b9c39e89d 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -57,6 +57,8 @@ class InfoRequest < ActiveRecord::Base
'waiting_response',
'waiting_clarification',
'gone_postal',
+ 'deadline_extended',
+ 'wrong_response',
'not_held',
'rejected', # this is called 'refused' in UK FOI law and the user interface, but 'rejected' internally for historic reasons
'successful',
@@ -511,6 +513,9 @@ public
# waiting_response_very_overdue
def calculate_status
return 'waiting_classification' if self.awaiting_description
+ # if deadline_extended expired do waiting_response_overdue
+ return 'waiting_response_overdue' if
+ self.described_state == "deadline_extended" && Time.now.strftime("%Y-%m-%d") > self.date_deadline_extended.strftime("%Y-%m-%d")
return described_state unless self.described_state == "waiting_response"
# Compare by date, so only overdue on next day, not if 1 second late
return 'waiting_response_very_overdue' if
@@ -607,7 +612,8 @@ public
# last_event_forming_initial_request. There may be more obscure
# things, e.g. fees, not properly covered.
def date_response_required_by
- return Holiday.due_date_from(self.date_initial_request_last_sent_at, 20)
+ days_later = MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20)
+ return Holiday.due_date_from(self.date_initial_request_last_sent_at, days_later)
end
# This is a long stop - even with UK public interest test extensions, 40
# days is a very long time.
@@ -621,7 +627,10 @@ public
return Holiday.due_date_from(self.date_initial_request_last_sent_at, 40)
end
end
-
+ # deadline_extended
+ def date_deadline_extended
+ return Holiday.due_date_from(self.date_initial_request_last_sent_at, 15)
+ end
# Where the initial request is sent to
def recipient_email
return self.public_body.request_email
@@ -741,35 +750,39 @@ public
def display_status
status = self.calculate_status
if status == 'waiting_classification'
- "Awaiting classification."
+ _("Awaiting classification.")
elsif status == 'waiting_response'
- "Awaiting response."
+ _("Awaiting response.")
elsif status == 'waiting_response_overdue'
- "Delayed."
+ _("Delayed.")
elsif status == 'waiting_response_very_overdue'
- "Long overdue."
+ _("Long overdue.")
elsif status == 'not_held'
- "Information not held."
+ _("Information not held.")
elsif status == 'rejected'
- "Refused."
+ _("Refused.")
elsif status == 'partially_successful'
- "Partially successful."
+ _("Partially successful.")
elsif status == 'successful'
- "Successful."
+ _("Successful.")
elsif status == 'waiting_clarification'
- "Waiting clarification."
+ _("Waiting clarification.")
elsif status == 'gone_postal'
- "Handled by post."
+ _("Handled by post.")
+ elsif status == 'deadline_extended'
+ _("Deadline extended.")
+ elsif status == 'wrong_response'
+ _("Wrong Response.")
elsif status == 'internal_review'
- "Awaiting internal review."
+ _("Awaiting internal review.")
elsif status == 'error_message'
- "Delivery error"
+ _("Delivery error")
elsif status == 'requires_admin'
- "Unusual response."
+ _("Unusual response.")
elsif status == 'user_withdrawn'
- "Withdrawn by the requester."
+ _("Withdrawn by the requester.")
else
- raise "unknown status " + status
+ raise _("unknown status ") + status
end
end
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index 1b22fa547..02b9a34ac 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -62,6 +62,8 @@ class InfoRequestEvent < ActiveRecord::Base
'waiting_response',
'waiting_clarification',
'gone_postal',
+ 'deadline_extended',
+ 'wrong_response',
'not_held',
'rejected',
'successful',
@@ -283,27 +285,31 @@ class InfoRequestEvent < ActiveRecord::Base
status = self.calculated_state
if !status.nil?
if status == 'waiting_response'
- return "Acknowledgement"
+ return _("Acknowledgement")
elsif status == 'waiting_clarification'
- return "Clarification required"
+ return _("Clarification required")
elsif status == 'gone_postal'
- return "Handled by post"
+ return _("Handled by post")
+ elsif status == 'deadline_extended'
+ return _("Deadline Extended")
+ elsif status == 'wrong_response'
+ return _("Wrong Response")
elsif status == 'not_held'
- return "Information not held"
+ return _("Information not held")
elsif status == 'rejected'
- return "Refused"
+ return _("Refused")
elsif status == 'partially_successful'
- return "Some information sent"
+ return _("Some information sent")
elsif status == 'successful'
- return "All information sent"
+ return _("All information sent")
elsif status == 'internal_review'
- return "Internal review acknowledgement"
+ return _("Internal review acknowledgement")
elsif status == 'user_withdrawn'
- return "Withdrawn by requester"
+ return _("Withdrawn by requester")
elsif status == 'error_message'
- return "Delivery error"
+ return _("Delivery error")
elsif status == 'requires_admin'
- return "Unusual response"
+ return _("Unusual response")
end
raise "unknown status " + status
end
@@ -314,17 +320,17 @@ class InfoRequestEvent < ActiveRecord::Base
status = self.calculated_state
if !status.nil?
if status == 'internal_review'
- return "Internal review request"
+ return _("Internal review request")
end
if status == 'waiting_response'
- return "Clarification"
+ return _("Clarification")
end
- raise "unknown status " + status
+ raise _("unknown status ") + status
end
- return "Follow up"
+ return _("Follow up")
end
- raise "display_status only works for incoming and outgoing messages right now"
+ raise _("display_status only works for incoming and outgoing messages right now")
end
def is_sent_sort?
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 220f4f0a7..f9baad9b0 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -54,7 +54,7 @@ class OutgoingMessage < ActiveRecord::Base
# How the default letter starts and ends
def get_salutation
- ret = "Dear "
+ ret = _("Dear ")
if self.message_type == 'followup' && !self.incoming_message_followup.nil? && !self.incoming_message_followup.safe_mail_from.nil? && self.incoming_message_followup.valid_to_reply_to?
ret = ret + OutgoingMailer.name_for_followup(self.info_request, self.incoming_message_followup)
else
@@ -64,13 +64,13 @@ class OutgoingMessage < ActiveRecord::Base
end
def get_signoff
if self.message_type == 'followup' && !self.incoming_message_followup.nil? && !self.incoming_message_followup.safe_mail_from.nil? && self.incoming_message_followup.valid_to_reply_to?
- return "Yours sincerely,"
+ return _("Yours sincerely,")
else
- return "Yours faithfully,"
+ return _("Yours faithfully,")
end
end
def get_internal_review_insert_here_note
- return "GIVE DETAILS ABOUT YOUR COMPLAINT HERE"
+ return _("GIVE DETAILS ABOUT YOUR COMPLAINT HERE")
end
def get_default_letter
if self.default_letter
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 520e28aab..0e32a5164 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -54,24 +54,39 @@ class PublicBody < ActiveRecord::Base
# like find_by_url_name but also search historic url_name if none found
def self.find_by_url_name_with_historic(name)
- found = PublicBody.find_all_by_url_name(name)
- return found.first if found.size == 1
- # Shouldn't we just make url_name unique?
- raise "Two bodies with the same URL name: #{name}" if found.size > 1
- # If none found, then search the history of short names
- old = PublicBody::Version.find_all_by_url_name(name)
- # Find unique public bodies in it
- old = old.map { |x| x.public_body_id }
- old = old.uniq
- # Maybe return the first one, so we show something relevant,
- # rather than throwing an error?
- raise "Two bodies with the same historical URL name: #{name}" if old.size > 1
- return unless old.size == 1
- # does acts_as_versioned provide a method that returns the current version?
- return PublicBody.find(old.first)
+ @locale = I18n.locale.to_s
+ PublicBody.with_locale(@locale) do
+ found = PublicBody.find(:all,
+ :conditions => ["public_body_translations.url_name='#{name}'"],
+ :joins => :translations,
+ :readonly => false)
+ return found.first if found.size == 1
+ # Shouldn't we just make url_name unique?
+ raise "Two bodies with the same URL name: #{name}" if found.size > 1
+ # If none found, then search the history of short names
+ old = PublicBody::Version.find_all_by_url_name(name)
+ # Find unique public bodies in it
+ old = old.map { |x| x.public_body_id }
+ old = old.uniq
+ # Maybe return the first one, so we show something relevant,
+ # rather than throwing an error?
+ raise "Two bodies with the same historical URL name: #{name}" if old.size > 1
+ return unless old.size == 1
+ # does acts_as_versioned provide a method that returns the current version?
+ return PublicBody.find(old.first)
+ end
end
-
+ # XXX this should be saner; probably implement categories as data
+ begin
+ load "public_body_categories_#{I18n.locale.to_s}.rb"
+ rescue MissingSourceFile
+ begin
+ load "public_body_categories_#{I18n.default_locale.to_s}.rb"
+ rescue MissingSourceFile
+ load "public_body_categories.rb"
+ end
+ end
# Set the first letter, which is used for faster queries
before_save(:set_first_letter)
def set_first_letter
@@ -278,6 +293,7 @@ class PublicBody < ActiveRecord::Base
:request_email => MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'),
:home_page => "",
:notes => "",
+ :publication_scheme => "",
:last_edit_editor => "internal_admin",
:last_edit_comment => "Made by PublicBody.internal_admin_body"
)
@@ -343,7 +359,7 @@ class PublicBody < ActiveRecord::Base
else
# New public body
notes.push "line " + line.to_s + ": new authority '" + name + "' with email " + email
- public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :home_page => "", :notes => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet')
+ public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :home_page => "", :publication_scheme => "", :notes => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet')
public_body.tag_string = tag
public_body.save!
end
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 9d6f40ed7..aee1ed1da 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -152,15 +152,15 @@ class TrackThing < ActiveRecord::Base
@params = {
# Website
:list_description => "any <a href=\"/list/successful\">successful requests</a>",
- :verb_on_page => "Email me new successful responses",
- :verb_on_page_already => "You are being emailed about any new successful responses",
+ :verb_on_page => _("Email me new successful responses "),
+ :verb_on_page_already => _("You are being emailed about any new successful responses"),
# Email
- :title_in_email => "Successful Freedom of Information requests",
- :title_in_rss => "Successful Freedom of Information requests",
+ :title_in_email => _("Successful Freedom of Information requests"),
+ :title_in_rss => _("Successful Freedom of Information requests"),
# Authentication
- :web => "To be emailed about any successful requests",
- :email => "Then you will be emailed whenever an FOI request succeeds.",
- :email_subject => "Confirm you want to be emailed when an FOI request succeeds",
+ :web => _("To be emailed about any successful requests"),
+ :email => _("Then you will be emailed whenever an FOI request succeeds."),
+ :email_subject => _("Confirm you want to be emailed when an FOI request succeeds"),
# RSS sorting - used described date, as newest would give a
# date for responses possibly days before description, so
# wouldn't appear at top of list when description (known
@@ -171,7 +171,7 @@ class TrackThing < ActiveRecord::Base
@params = {
# Website
:list_description => "'<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>', a public authority", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
- :verb_on_page => "Track requests to " + CGI.escapeHTML(self.public_body.name) + " by email",
+ :verb_on_page => _("Track requests to {{public_body_name}} by email",:public_body_name=>CGI.escapeHTML(self.public_body.name)),
:verb_on_page_already => "You are already tracking requests to " + CGI.escapeHTML(self.public_body.name) + " by email",
# Email
:title_in_email => self.public_body.law_only_short + " requests to '" + self.public_body.name + "'",
diff --git a/app/models/user.rb b/app/models/user.rb
index 2fd6d9dbe..e29ae3101 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -31,11 +31,11 @@ require 'digest/sha1'
class User < ActiveRecord::Base
strip_attributes!
- validates_presence_of :email, :message => N_("Please enter your email address")
+ validates_presence_of :email, :message => _("Please enter your email address")
- validates_presence_of :name, :message => N_("Please enter your name")
+ validates_presence_of :name, :message => _("Please enter your name")
- validates_presence_of :hashed_password, :message => N_("Please enter a password")
+ validates_presence_of :hashed_password, :message => _("Please enter a password")
has_many :info_requests, :order => 'created_at desc'
has_many :user_info_request_sent_alerts
@@ -46,7 +46,7 @@ class User < ActiveRecord::Base
has_many :censor_rules, :order => 'created_at desc'
attr_accessor :password_confirmation, :no_xapian_reindex
- validates_confirmation_of :password, :message => N_("Please enter the same password twice")
+ validates_confirmation_of :password, :message => _("Please enter the same password twice")
validates_inclusion_of :admin_level, :in => [
'none',
@@ -103,10 +103,10 @@ class User < ActiveRecord::Base
def validate
if self.email != "" && !MySociety::Validate.is_valid_email(self.email)
- errors.add(:email, N_("Please enter a valid email address"))
+ errors.add(:email, _("Please enter a valid email address"))
end
if MySociety::Validate.is_valid_email(self.name)
- errors.add(:name, N_("Please enter your name, not your email address, in the name field."))
+ errors.add(:name, _("Please enter your name, not your email address, in the name field."))
end
end
@@ -129,9 +129,9 @@ class User < ActiveRecord::Base
params[:email].strip!
if specific_user_login
- auth_fail_message = "Either the email or password was not recognised, please try again."
+ auth_fail_message = _("Either the email or password was not recognised, please try again.")
else
- auth_fail_message = "Either the email or password was not recognised, please try again. Or create a new account using the form on the right."
+ auth_fail_message = _("Either the email or password was not recognised, please try again. Or create a new account using the form on the right.")
end
user = self.find_user_by_email(params[:email])
diff --git a/app/models/user_mailer.rb b/app/models/user_mailer.rb
index 70ca42675..f164f684e 100644
--- a/app/models/user_mailer.rb
+++ b/app/models/user_mailer.rb
@@ -31,7 +31,7 @@ class UserMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces when people are fiddling with their account
@recipients = new_email
- @subject = "Confirm your new email address on WhatDoTheyKnow.com"
+ @subject = _("Confirm your new email address on WhatDoTheyKnow.com")
@body[:name] = user.name
@body[:url] = url
@body[:old_email] = user.email
@@ -42,7 +42,7 @@ class UserMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces when people are fiddling with their account
@recipients = new_email
- @subject = "Unable to change email address on WhatDoTheyKnow.com"
+ @subject = _("Unable to change email address on WhatDoTheyKnow.com")
@body[:old_email] = old_email
@body[:new_email] = new_email
end
diff --git a/app/views/admin_general/stats.rhtml b/app/views/admin_general/stats.rhtml
index f95d381fb..b22adb581 100644
--- a/app/views/admin_general/stats.rhtml
+++ b/app/views/admin_general/stats.rhtml
@@ -32,8 +32,7 @@
<h2>Web analytics</h2>
-<p><a href="http://piwik.mysociety.org/index.php?module=CoreHome&action=index&idSite=4&period=month&date=yesterday">WhatDoTheyKnow on piwik</a>
-<br><a href="https://secure.mysociety.org/admin/awstats.pl?config=www.whatdotheyknow.com">WhatDoTheyKnow on awstats</a>
+
</p>
diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.rhtml
index 509cc05bb..d430f25c8 100644
--- a/app/views/comment/_comment_form.rhtml
+++ b/app/views/comment/_comment_form.rhtml
@@ -12,8 +12,8 @@
<p>
<%= hidden_field_tag 'submitted_comment', 1 %>
<%= hidden_field_tag 'preview', 1 %>
- <%= submit_tag "Preview your annotation" %>
- (<strong>no ranty</strong> politics, read our <a href="/help/requesting#moderation">moderation policy</a>)
+ <%= submit_tag _('Preview your annotation') %>
+ <%= _(' (<strong>no ranty</strong> politics, read our <a href="%s">moderation policy</a>)') % [help_requesting_path+'#moderation'] %>
</p>
<% end %>
diff --git a/app/views/comment/_single_comment.rhtml b/app/views/comment/_single_comment.rhtml
index d4282ced8..e6a1728a8 100644
--- a/app/views/comment/_single_comment.rhtml
+++ b/app/views/comment/_single_comment.rhtml
@@ -7,8 +7,7 @@
<h2>
<%# When not logged in, but mid-comment-leaving, there'll be no comment.user %>
- <%= comment.user ? user_link(comment.user) : "You" %>
- left an annotation (<%= simple_date(comment.created_at || Time.now) %>)
+ <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>)
</h2>
<div class="comment_in_request_text">
<p>
@@ -22,7 +21,7 @@
<% if !@user.nil? && @user.admin_page_links? %>
| <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
<% end %>
- <!-- | <%= link_to "Report abuse", comment_url(comment) %> -->
+ <!-- | <%= link_to _('Report abuse'), comment_url(comment) %> -->
<% end %>
</p>
</div>
diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml
index 7d7dfee6f..25380d23f 100644
--- a/app/views/comment/new.rhtml
+++ b/app/views/comment/new.rhtml
@@ -11,63 +11,63 @@
<%= foi_error_messages_for :comment %>
-<h1>Add an annotation to '<%=request_link(@info_request)%>'</h1>
+<h1><%= _('Add an annotation to ')%>'<%=request_link(@info_request)%>'</h1>
<p>
-Annotations are so anyone, including you, can help the requester with their request. For example:
+<%= _('Annotations are so anyone, including you, can help the requester with their request. For example:')%>
</p>
<ul>
<% if [ 'waiting_clarification' ].include?(@info_request.described_state) %>
- <li> Advise on how to <strong>best clarify</strong> the request.</li>
+ <li><%= _(' Advise on how to <strong>best clarify</strong> the request.')%></li>
<% end %>
<% if not [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>
- <li> Link to the information requested, if it is <strong>already available</strong> on the Internet. </li>
- <li> Suggest <strong>where else</strong> the requester might find the information. </li>
- <li> Offer better ways of <strong>wording the request</strong> to get the information. </li>
+ <li><%= _(' Link to the information requested, if it is <strong>already available</strong> on the Internet. ')%></li>
+ <li><%= _(' Suggest <strong>where else</strong> the requester might find the information. ')%></li>
+ <li><%= _(' Offer better ways of <strong>wording the request</strong> to get the information. ')%></li>
<% end %>
<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>
- <li> <strong>Summarise</strong> the content of any information returned. </li>
- <li> Say how you've <strong>used the information</strong>, with links if possible. </li>
- <li> <strong>Thank</strong> the public authority or <%=h @info_request.user.name %>. </li>
+ <li><%= _(' <strong>Summarise</strong> the content of any information returned. ')%></li>
+ <li><%= _(' Say how you\'ve <strong>used the information</strong>, with links if possible.')%> </li>
+ <li> <%= _('<strong>Thank</strong> the public authority or ')%><%=h @info_request.user.name %>. </li>
<% end %>
<% if [ 'partially_successful' ].include?(@info_request.described_state) %>
- <li> Suggest how the requester can find the <strong>rest of the information</strong>. </li>
+ <li> <%= _('Suggest how the requester can find the <strong>rest of the information</strong>.')%></li>
<% end %>
<% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %>
- <li> Point to <strong>related information</strong>, campaigns or forums which may be useful. </li>
+ <li> <%= _('Point to <strong>related information</strong>, campaigns or forums which may be useful.')%></li>
<% end %>
<% if [ 'gone_postal' ].include?(@info_request.described_state) %>
- <li> A <strong>summary</strong> of the response if you have received it by post. </li>
+ <li> <%= _('A <strong>summary</strong> of the response if you have received it by post. ')%></li>
<% end %>
<% if [ 'not_held' ].include?(@info_request.described_state) %>
- <li> Ideas on what <strong>other documents to request</strong> which the authority may hold. </li>
+ <li><%= _(' Ideas on what <strong>other documents to request</strong> which the authority may hold. ')%></li>
<% end %>
<% if [ 'rejected' ].include?(@info_request.described_state) %>
- <li> Advise on whether the <strong>refusal is legal</strong>, and how to complain about it if not. </li>
+ <li> <%= _('Advise on whether the <strong>refusal is legal</strong>, and how to complain about it if not.') %> </li>
<% end %>
<% if [ 'internal_review' ].include?(@info_request.described_state) %>
- <li> <strong>Advice</strong> on how to get a response that will satisfy the requester. </li>
+ <li> <%= _('<strong>Advice</strong> on how to get a response that will satisfy the requester. </li>') %>
<% end %>
<% if [ 'error_message' ].include?(@info_request.described_state) %>
- <li> You know what caused the error, and can <strong>suggest a solution</strong>, such as a working email address. </li>
+ <li> <%= _('You know what caused the error, and can <strong>suggest a solution</strong>, such as a working email address.')%> </li>
<% end %>
<% if [ 'requires_admin' ].include?(@info_request.described_state) %>
- <li> Your thoughts on what the WhatDoTheyKnow <strong>administrators</strong> should do about the request. </li>
+ <li> <%= _('Your thoughts on what the WhatDoTheyKnow <strong>administrators</strong> should do about the request.') %> </li>
<% end %>
</ul>
<p>
- <big>Annotations will be posted publicly here, and are
- <strong>not</strong> sent to <%=h @info_request.public_body.name %>.</big>
+ <big><%= _('Annotations will be posted publicly here, and are
+ <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></big>
</p>
<%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %>
diff --git a/app/views/comment/preview.rhtml b/app/views/comment/preview.rhtml
index 38c5fe1ff..702bd9a9b 100644
--- a/app/views/comment/preview.rhtml
+++ b/app/views/comment/preview.rhtml
@@ -1,13 +1,13 @@
-<% @title = "Preview new annotation on '" + h(@info_request.title) + "'" %>
+<% @title = _("Preview new annotation on '{{info_request_title}}'",:info_request_title=>h(@info_request.title)) %>
<% form_for(:comment, @comment, :html => { :id => 'preview_form' }, :url => { :controller => "comment", :action => "new", :type => "request" } ) do |f| %>
- <h1>Now preview your annotation</h1>
+ <h1><%= _('Now preview your annotation') %></h1>
<%= render :partial => 'comment/single_comment', :locals => { :comment => @comment } %>
<p>
- Your name and annotation will appear in <strong>search engines</strong>.
+ <%= _('Your name and annotation will appear in <strong>search engines</strong>.')%>
</p>
<p>
@@ -17,8 +17,8 @@
<% end %>
<%= hidden_field_tag(:submitted_comment, 1) %>
<%= hidden_field_tag(:preview, 0 ) %>
- <%= submit_tag "Re-edit this annotation", :name => 'reedit' %>
- <%= submit_tag "Post annotation", :name => 'submit' %>
+ <%= submit_tag _("Re-edit this annotation"), :name => 'reedit' %>
+ <%= submit_tag _("Post annotation"), :name => 'submit' %>
</p>
<% end %>
diff --git a/app/views/contact_mailer/message.rhtml b/app/views/contact_mailer/message.rhtml
index ad868ec5b..a28d9603b 100644
--- a/app/views/contact_mailer/message.rhtml
+++ b/app/views/contact_mailer/message.rhtml
@@ -1,11 +1,11 @@
<%= @message.strip %>
---------------------------------------------------------------------
-Message sent using WhatDoTheyKnow contact form,
+<%= _('Message sent using WhatDoTheyKnow contact form, ')%>
<%=(@logged_in_user ? ("logged in as user " + main_url(user_url(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %>
-Last request viewed: <%= main_url(request_url(@last_request)) %>
+<%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %>
<% end %> <% if !@last_body.nil? %>
-Last authority viewed: <%= main_url(public_body_url(@last_body)) %>
+<%= _('Last authority viewed: ')%><%= main_url(public_body_url(@last_body)) %>
<% end %>---------------------------------------------------------------------
diff --git a/app/views/contact_mailer/user_message.rhtml b/app/views/contact_mailer/user_message.rhtml
index 436b73d1e..7a685c452 100644
--- a/app/views/contact_mailer/user_message.rhtml
+++ b/app/views/contact_mailer/user_message.rhtml
@@ -1,12 +1,12 @@
---------------------------------------------------------------------
<%=@from_user.name%> has used WhatDoTheyKnow to send you the message below.
-Your details have not been given to anyone, unless you choose to reply to this
-message, which will then go directly to the person who wrote the message.
+<%= _('Your details have not been given to anyone, unless you choose to reply to this
+message, which will then go directly to the person who wrote the message.')%>
---------------------------------------------------------------------
<%= @message.strip %>
---------------------------------------------------------------------
-View Freedom of Information requests made by <%=@from_user.name %>:
+<%= _('View Freedom of Information requests made by')%> <%=@from_user.name %>:
<%= @from_user_url %>
---------------------------------------------------------------------
diff --git a/app/views/general/_before_body_end.rhtml b/app/views/general/_before_body_end.rhtml
index 8d7ebeeb5..4374a3f28 100644
--- a/app/views/general/_before_body_end.rhtml
+++ b/app/views/general/_before_body_end.rhtml
@@ -1,16 +1 @@
-<% if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.whatdotheyknow.com' %>
-<!-- Piwik -->
-<script type="text/javascript">
-var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/");
-document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
-</script><script type="text/javascript">
-try {
-var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
-piwikTracker.trackPageView();
-piwikTracker.enableLinkTracking();
-} catch( err ) {}
-</script><noscript><p><img src="http://piwik.mysociety.org/piwik.php?idsite=4" style="border:0" alt=""/></p></noscript>
-<!-- End Piwik Tag -->
-<% end %>
-
-
+<!-- TO DO: add here Analytics Scripts (Google or something else) -->
diff --git a/app/views/general/_credits.rhtml b/app/views/general/_credits.rhtml
index a2f7a9cb2..8c519ce7e 100644
--- a/app/views/general/_credits.rhtml
+++ b/app/views/general/_credits.rhtml
@@ -1,5 +1 @@
-|
- Built by <a href="http://www.mysociety.org/">mySociety</a> ...
- <a href="/help/credits#helpus">and you</a>
- |
- Dedicated to <a href="http://mk.ucant.org/archives/000129.html">Chris Lightfoot</a>
+| <%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>.') %>
diff --git a/app/views/general/_locale_switcher.rhtml b/app/views/general/_locale_switcher.rhtml
index 530fbc40c..27e492e84 100644
--- a/app/views/general/_locale_switcher.rhtml
+++ b/app/views/general/_locale_switcher.rhtml
@@ -1,12 +1,11 @@
-<% if FastGettext.default_available_locales.length > 1 && !params.empty? %>
- <div id="user_locale_switcher">
- Language:
- <% for possible_locale in FastGettext.default_available_locales %>
- <% if possible_locale == I18n.locale.to_s %>
- <%= possible_locale %>
- <% else %>
- <a href="<%= locale_switcher(possible_locale, params) %>"><%= possible_locale %></a>
- <% end %>
- <% end %>
- </div>
-<% end %>
+ <% if FastGettext.default_available_locales.length > 1 && !params.empty? %>
+ <div id="user_locale_switcher">
+ <% for possible_locale in FastGettext.default_available_locales %>
+ <% if possible_locale == I18n.locale.to_s %>
+ <span class="active"><%= locale_name(possible_locale) %></span>
+ <% else %>
+ <a href="<%= locale_switcher(possible_locale, params) %>"><%= locale_name(possible_locale) %></a>
+ <% end %>
+ <% end %>
+ </div>
+ <% end %>
diff --git a/app/views/general/_orglink.rhtml b/app/views/general/_orglink.rhtml
index 551b18646..20d0d6ce4 100644
--- a/app/views/general/_orglink.rhtml
+++ b/app/views/general/_orglink.rhtml
@@ -1,2 +1,2 @@
<%-# Put the link to your organisation here, or leave blank -%>
-<a href="http://www.mysociety.org">a site by mysociety.org</a>
+<a href="http://www.alaveteli.org">an Alaveteli site</a>
diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml
index cda1c5769..843d31c0f 100644
--- a/app/views/general/blog.rhtml
+++ b/app/views/general/blog.rhtml
@@ -1,16 +1,47 @@
-<% @title = "WhatDoTheyKnow blog and tweets" %>
-
-<div id="blog_sidebar">
- <h1><img src="/images/twitter.png" alt=""> <a href="http://www.twitter.com/whatdotheyknow">Follow us on twitter</a></h1>
- <h1><img src="/images/rss.png" alt=""> <a href="http://www.mysociety.org/category/projects/whatdotheyknow/feed/">Subscribe to blog</h1>
-</div>
+<% @title = "#{site_name} blog and tweets" %>
<h1><%=@title %></h1>
+ <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/whatdotheyknow">Follow us on twitter</a>&nbsp;
+ <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="http://www.mysociety.org/category/projects/whatdotheyknow/feed/">Subscribe to blog</a>
+<% if !@twitter_user.empty? %>
+<div id="twitter">
+<script src="http://widgets.twimg.com/j/2/widget.js"></script>
+<script>
+new TWTR.Widget({
+ version: 2,
+ type: 'profile',
+ rpp: 15,
+ interval: 6000,
+ width: 'auto',
+ height: 500,
+ theme: {
+ shell: {
+ background: '#eaeaea',
+ color: '#000000'
+ },
+ tweets: {
+ background: '#ffffff',
+ color: '#000000',
+ links: '#0b004a'
+ }
+ },
+ features: {
+ scrollbar: false,
+ loop: false,
+ live: false,
+ hashtags: true,
+ timestamp: true,
+ avatars: false,
+ behavior: 'all'
+ }
+}).render().setUser('<%=@twitter_user %>').start();
+</script>
-<div id="blog">
+</div>
+<% end %>
-<% for item in @items: %>
- <% if item['comments'] %>
+<div id="blog">
+ <% for item in @blog_items: %>
<div class="blog_post">
<h2><a href="<%=item['link']%>"><%=h item['title'] %></a></h2>
<p class="subtitle">Posted on <%= simple_date(Time.parse(item['pubDate'][0])) %> by <%=h item['creator'] %></p>
@@ -20,18 +51,9 @@
</em>
</p>
</div>
- <% else %>
- <div class="twitter_post">
- <h2><a href="<%=item['link']%>">@whatdotheyknow on <%= simple_date(Time.parse(item['pubDate'][0])) %></a></h2>
- <p><%=MySociety::Format.make_clickable(h(item['title'][0].sub("WhatDoTheyKnow: ", ""))) %></a></p>
- <div>
- <% end %>
-
-<% end %>
-
-<p>
- <a href="http://www.mysociety.org/category/projects/whatdotheyknow/">All blog posts</a> |
- <a href="http://www.twitter.com/whatdotheyknow">@whatdotheyknow on twitter</a>
-</p>
-
+ <% end %>
+ <p>
+ <a href="http://www.mysociety.org/category/projects/whatdotheyknow/">All blog posts</a>
+ </p>
</div>
+
diff --git a/app/views/general/exception_caught.rhtml b/app/views/general/exception_caught.rhtml
index 44d5803de..ca36b592b 100644
--- a/app/views/general/exception_caught.rhtml
+++ b/app/views/general/exception_caught.rhtml
@@ -1,18 +1,17 @@
-<h1>Sorry, we couldn't find that page</h1>
+<h1><%= _("Sorry, we couldn't find that page") %></h1>
-<p>The page either doesn't exist, or is broken. Things you can try now:</p>
+<p><%= _("The page either doesn't exist, or is broken. Things you can try now:")%></p>
<ul>
-<li>Check for mistakes if you typed or copied the address.</li>
-<li>Search the site to find what you were looking for.
+<li><%= _("Check for mistakes if you typed or copied the address.")%></li>
+<li><%= _("Search the site to find what you were looking for.")%>
<% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form"}) do %>
<%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %>
+ <%= submit_tag _("Search") %>
<% end %>
</li>
-<li><a href="/help/contact">Contact us</a> to tell us about
- the problem</li>
-<li>Go to our <a href="/">front page</a></li>
+<li><%= _('<a href="%s">Contact us</a> to tell us about the problem</li>') % [help_contact_path] %>
+<li><%= _('Go to our <a href="%s">front page</a></li>') % ["/"] %>
</ul>
-<p id="error_technical_details"><strong>Technical details:</strong> <%=@exception_class ? @exception_class : "Unknown"%></p>
+<p id="error_technical_details"><%= _("<strong>Technical details:</strong>")%> <%=@exception_class ? @exception_class : _("Unknown")%></p>
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index f412a6964..241ecf2a9 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -1,4 +1,4 @@
-<% view_cache :ttl => 5.minutes do %>
+
<div id="frontpage_search">
<h1><%= _('Make or explore Freedom of Information requests') %></h1>
@@ -29,14 +29,14 @@
<div id="frontpage_examples">
<% if @popular_bodies.size > 0 %>
- <div id="examples_0">
- <ul>
+ <div id="examples_0">
+ <ul>
<% for popular_body in @popular_bodies %>
- <li><%=public_body_link(popular_body)%>
- <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>
+ <li><%=public_body_link(popular_body)%>
+ <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>
</li>
<% end%>
- </ul>
+ </ul>
<p><strong>
<%= link_to _('More authorities...'), list_public_bodies_default %>
</strong></p>
@@ -57,4 +57,4 @@
<% end %>
</div>
-<% end %>
+
diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml
index d1654c641..89a67d069 100644
--- a/app/views/help/about.rhtml
+++ b/app/views/help/about.rhtml
@@ -7,23 +7,23 @@
<dt id="purpose">What is WhatDoTheyKnow for? <a href="#purpose">#</a> </dt>
<dd>To help you find out inside information about what the UK government
-is doing.
-</dd>
+is doing.
+</dd>
<dt id="premise">How does the site work? <a href="#premise">#</a> </dt>
<dd>You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.
-</dd>
+</dd>
<dt id="whybother_me">Why would I bother to do this? <a href="#whybother_me">#</a> </dt>
<dd>You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
-are done badly, and to celebrate the things that are done well.
-</dd>
+are done badly, and to celebrate the things that are done well.
+</dd>
<dt id="whybother_them">Why would the public authority bother to reply? <a href="#whybother_them">#</a> </dt>
<dd>Under Freedom of Information (FOI) law, they have to respond. The response
@@ -33,9 +33,9 @@ it must be kept confidential.
<dt id="who">Who makes WhatDoTheyKnow? <a href="#who">#</a> </dt>
<dd>WhatDoTheyKnow is created and run by <a href="http://www.mysociety.org">mySociety</a>,
-and was initially <a href="http://www.mysociety.org/2006/12/06/funding-for-freedom-of-information/">funded by the JRSST Charitable Trust</a>. mySociety is a project of the
-registered charity <a href="http://www.ukcod.org.uk/UK_Citizens_Online_Democracy">UK Citizens Online Democracy</a>.
-If you like what we're doing, then you can
+and was initially <a href="http://www.mysociety.org/2006/12/06/funding-for-freedom-of-information/">funded by the JRSST Charitable Trust</a>. mySociety is a project of the
+registered charity <a href="http://www.ukcod.org.uk/UK_Citizens_Online_Democracy">UK Citizens Online Democracy</a>.
+If you like what we're doing, then you can
<a href="https://secure.mysociety.org/donate/">make a donation</a>.
</dd>
@@ -49,5 +49,3 @@ If you like what we're doing, then you can
<p><strong>Next</strong>, read about <a href="/help/requesting">making requests</a> --&gt;
<div id="hash_link_padding"></div>
-
-
diff --git a/app/views/help/requesting.rhtml b/app/views/help/requesting.rhtml
index 034bb31e5..dc70f3f89 100644
--- a/app/views/help/requesting.rhtml
+++ b/app/views/help/requesting.rhtml
@@ -140,6 +140,14 @@ are breaking the law.</p>
</dd>
+<dt id="deadline_extended">Deadline extended <a href="#deadline_extended">#</a> </dt>
+
+<dd>
+<p>By law, public authorities must needs <strong>more time</strong> for request ... (TO DO)
+</p>
+
+
+</dd>
<dt id="no_response">What if I never get a response?<a href="#no_response">#</a> </dt>
<dd>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index de02a87b2..159aa1e62 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -75,22 +75,22 @@
</div>
=end
%>
-
- <div id="banner">
- </div>
+<div class="entirebody">
+ <div id="banner"></div>
<div id="header">
<h1>
<%= link_to site_name, frontpage_url %>
</h1>
+
<div id="tagline">
<%= _('Make and explore Freedom of Information requests') %>
</div>
- <%= render :partial => 'general/locale_switcher' %>
</div>
- <div id="orglogo">
- <%= render :partial => 'general/orglink' %>
- </div>
+ <div id="orglogo">
+ <%= render :partial => 'general/orglink' %>
+ </div>
+ <div class="lang"><%= render :partial => 'general/locale_switcher' %></div>
<div id="navigation_search">
<% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>
@@ -99,6 +99,7 @@
<%= submit_tag _("Search") %>
</p>
<% end %>
+
</div>
<div id="topnav">
<ul id="navigation">
@@ -125,6 +126,7 @@
</div>
<div id="wrapper">
+
<div id="content">
<% if flash[:notice] %>
@@ -144,8 +146,9 @@
<%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
<%= render :partial => 'general/credits' %>
</div>
+ <div class="after-footer">&nbsp;</div>
<%= render :partial => 'general/before_body_end' %>
-
+</div>
</body>
</html>
diff --git a/app/views/outgoing_mailer/_followup_footer.rhtml b/app/views/outgoing_mailer/_followup_footer.rhtml
new file mode 100644
index 000000000..d7bc7c5aa
--- /dev/null
+++ b/app/views/outgoing_mailer/_followup_footer.rhtml
@@ -0,0 +1,4 @@
+<%= _('Disclaimer: This message and any reply that you make will be published on the internet. Our privacy and copyright policies:')%>
+<%= help_officers_url %>
+
+<%= _('If you find this service useful as an FOI officer, please ask your web manager to link to us from your organisation\'s FOI page.')%>
diff --git a/app/views/outgoing_mailer/followup.rhtml b/app/views/outgoing_mailer/followup.rhtml
index 361a819a2..7050a295b 100644
--- a/app/views/outgoing_mailer/followup.rhtml
+++ b/app/views/outgoing_mailer/followup.rhtml
@@ -3,11 +3,8 @@
<%= @outgoing_message.quoted_part_to_append_to_email.strip %>
-------------------------------------------------------------------
-Disclaimer: This message and any reply that you make will be published on the internet. Our privacy and copyright policies:
-http://www.whatdotheyknow.com/help/officers
-
-Please use this email address for all replies to this request:
+<%= _('Please use this email address for all replies to this request:')%>
<%= @info_request.incoming_email %>
-If you find WhatDoTheyKnow useful as an FOI officer, please ask your web manager to suggest us on your organisation's FOI page.
+<%= render :partial => 'followup_footer' %>
-------------------------------------------------------------------
diff --git a/app/views/outgoing_mailer/initial_request.rhtml b/app/views/outgoing_mailer/initial_request.rhtml
index e0acdb4a0..13b356c6e 100644
--- a/app/views/outgoing_mailer/initial_request.rhtml
+++ b/app/views/outgoing_mailer/initial_request.rhtml
@@ -1,14 +1,12 @@
<%= @outgoing_message.body.strip %>
-------------------------------------------------------------------
-Disclaimer: This message and any reply that you make will be published on the internet. Our privacy and copyright policies:
-http://www.whatdotheyknow.com/help/officers
-Please use this email address for all replies to this request:
+<%= _('Please use this email address for all replies to this request:')%>
<%= @info_request.incoming_email %>
-Is <%= @info_request.public_body.request_email%> the wrong address for <%= @info_request.law_used_full %> requests to <%= @info_request.public_body.name%>? If so please contact us using this form:
-http://www.whatdotheyknow.com/help/contact
+<%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests tp {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%>
+
+<%= render :partial => 'followup_footer' %>
-If you find WhatDoTheyKnow useful as an FOI officer, please ask your web manager to suggest us on your organisation's FOI page.
-------------------------------------------------------------------
diff --git a/app/views/public_body/_body_listing.rhtml b/app/views/public_body/_body_listing.rhtml
index 48eb649c2..48b6e8245 100644
--- a/app/views/public_body/_body_listing.rhtml
+++ b/app/views/public_body/_body_listing.rhtml
@@ -1,5 +1,5 @@
<% if public_bodies.empty? %>
- None found.
+ <%= _("None found.")%>
<% else %>
<% for public_body in public_bodies %>
<%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => public_body } %>
diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.rhtml
index fdd0c6b75..97cfd2e71 100644
--- a/app/views/public_body/_body_listing_single.rhtml
+++ b/app/views/public_body/_body_listing_single.rhtml
@@ -20,7 +20,7 @@
<span class="bottomline">
<%= pluralize(public_body.info_requests.size, "request") %> made.
<% if !@include_request_link_in_authority_listing.nil? %>
- <%= link_to "Make your own request", public_body_url(public_body) %>.
+ <%= link_to _("Make your own request"), public_body_url(public_body) %>.
<% end %>
<br>
Added on <%= simple_date(public_body.created_at) %>.
diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml
index dc6d0ca0e..5d88b1501 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.rhtml
@@ -1,8 +1,8 @@
<div id="body_sidebar">
- <h1>Show only...</h1>
+ <h1><%=_('Show only...')%></h1>
- <h2>Alphabet</h2>
+ <h2><%=_('Alphabet') %></h2>
<ul><li>
<%= render :partial => 'alphabet' %>
</li></ul>
@@ -26,21 +26,21 @@
</ul>
<p>
- <a href="/help/requesting#missing_body">Are we missing a public authority?</a>
+ <%= _('<a href="%s">Are we missing a public authority?</a>.') % [help_requesting_path + '#missing_body'] %>
</p>
<p>
- <%= link_to "List of all authorities (CSV)", all_public_bodies_csv_url() %>
+ <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>
</p>
</div>
-<% @title = "Public authorities - " + @description %>
+<% @title = _("Public authorities - {{description}}", :description => @description) %>
<h1><%=@title%></h1>
<p class="subtitle">
- <%= @public_bodies.size %> in total
- (<a href="/help/requesting#missing_body">can't find the one you want?</a>)
+ <%= @public_bodies.size %> <%= _('in total') %>
+ (<%= _('<a href="%s">can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>)
</p>
<% if @tag.size == 1 %>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 94022198a..dce7ca4f8 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -1,5 +1,4 @@
<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %>
-
<div id="request_sidebar">
<h2><%= _('Track this authority')%></h2>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
@@ -25,7 +24,9 @@
<h1><%=h(@public_body.name)%></h1>
<p class="subtitle">
-<%=@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 %>
+<%=@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) %>)
<% end %>
@@ -43,7 +44,7 @@
<strong>
<% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
<% if @public_body.eir_only? %>
- <%= link_to "Make a new Environmental Information request", new_request_to_body_url(:url_name => @public_body.url_name)%> to <%= h(@public_body.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 %>
<%= _('<a href="%s">Make a new Freedom of Information request</a> to {{public_body_name}}',
@@ -65,18 +66,18 @@
<% if !@xapian_requests.nil? %>
<% if @xapian_requests.results.empty? %>
<% if @public_body.eir_only? %>
- <h2>Environmental Information Regulations requests made using this site</h2>
+ <h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
<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 {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></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
+ <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %>
<% else %>
- <%= n_('%d Freedom of Information request', '%d Freedom of Information requests', @public_body.info_requests.size) % @public_body.info_requests.size %> made using this site
+ <%= n_('%d Freedom of Information request', '%d Freedom of Information requests', @public_body.info_requests.size) % @public_body.info_requests.size %> made using this site
<% end %>
<%= @page_desc %>
</h2>
@@ -92,7 +93,7 @@
<% end %>
<% else %>
<% if @public_body.eir_only? %>
- <h2>Environmental Information Regulations requests made</h2>
+ <h2><%= _('Environmental Information Regulations requests made') %></h2>
<% else %>
<h2> <%= _('Freedom of Information requests made')%></h2>
<% end %>
diff --git a/app/views/public_body/view_email.rhtml b/app/views/public_body/view_email.rhtml
index 2bd7c38c4..d6c8d85fe 100644
--- a/app/views/public_body/view_email.rhtml
+++ b/app/views/public_body/view_email.rhtml
@@ -1,21 +1,20 @@
<% @title = "FOI email address for '" + h(@public_body.name) + "'" %>
-<h1>FOI email address for '<%=public_body_link(@public_body)%>'</h1>
+<h1><%= _('FOI email address for {{public_body}}',:public_body=> public_body_link(@public_body))%></h1>
<p>
<% if @public_body.is_requestable? %>
- WhatDoTheyKnow sends new requests to <strong><%=h @public_body.request_email%></strong> for this authority.
+<%= _('WhatDoTheyKnow sends new requests to <strong>{{request_email}}</strong> for this authority.',:request_email=> h(@public_body.request_email))%>
<% else %>
<% if @public_body.not_requestable_reason == 'not_apply' %>
- <p>Freedom of Information law no longer applies to this authority.
- Follow up messages to existing requests are sent to <strong><%=h @public_body.request_email%></strong>.
+ <p><%= _('Freedom of Information law no longer applies to this authority.Follow up messages to existing requests are sent to ')%><strong><%=h @public_body.request_email%></strong>.
</p>
<% elsif @public_body.not_requestable_reason == 'defunct' %>
<p><%=h @public_body.name %> no longer exists.
- Follow up messages to existing requests are sent to <strong><%=h @public_body.request_email%></strong>.
+ <%= _('Follow up messages to existing requests are sent to ')%><strong><%=h @public_body.request_email%></strong>.
</p>
<% elsif @public_body.not_requestable_reason == 'bad_contact' %>
- <p>We do not have a working request email address for this authority.
+ <p><%= _('We do not have a working request email address for this authority.')%>
</p>
<% else %>
<% raise "unknown reason " + @reason %>
@@ -26,10 +25,10 @@
<p>
<% if @public_body.is_requestable? || @public_body.not_requestable_reason != 'bad_contact' %>
- If the address is wrong, or you know a better address, please <a href="/help/contact">contact us</a>.
+ <%= _('If the address is wrong, or you know a better address, please <a href="%s">contact us</a>.')% [help_contact_path]%>
<% else %>
- If you know the address to use, then please <a href="/help/contact">send it to us</a>.
- You may be able to find the address on their website, or by phoning them up and asking.
+ <%= _(' If you know the address to use, then please <a href="%s">send it to us</a>.
+ You may be able to find the address on their website, or by phoning them up and asking.')% [help_contact_path] %>
<% end %>
</p>
diff --git a/app/views/public_body/view_email_captcha.rhtml b/app/views/public_body/view_email_captcha.rhtml
index 13741c292..6f301e055 100644
--- a/app/views/public_body/view_email_captcha.rhtml
+++ b/app/views/public_body/view_email_captcha.rhtml
@@ -1,16 +1,13 @@
-<% @title = "View FOI email address for '" + h(@public_body.name) + "'" %>
+<% @title = _("View FOI email address for '{{public_body_name}}'",:public_body_name => h(@public_body.name)) %>
-<h1>View FOI email address for '<%=public_body_link(@public_body)%>'</h1>
+<h1><%= _('View FOI email address for {{public_body_name}}',:public_body_name=>public_body_link(@public_body))%></h1>
-<p>To view the email address that we use to send FOI requests to <%=h @public_body.name%>,
-please enter these words.<p>
+<p><%= _('To view the email address that we use to send FOI requests to {{public_body_name}}, please enter these words.', :public_body_name => h(@public_body.name))%></p>
<% form_for :contact do |f| %>
<%= recaptcha_tags %>
<%= hidden_field_tag(:submitted_view_email, { :value => 1 } ) %>
- <p><%= submit_tag "View email" %></p>
+ <p><%= submit_tag _("View email") %></p>
<% end %>
-
-
diff --git a/app/views/request/_after_actions.rhtml b/app/views/request/_after_actions.rhtml
index 9bef04ce4..797ecaea5 100644
--- a/app/views/request/_after_actions.rhtml
+++ b/app/views/request/_after_actions.rhtml
@@ -1,52 +1,50 @@
<div id="after_actions">
- <h2>Things to do with this request</h2>
+ <h2><%= _('Things to do with this request') %></h2>
<div id="anyone_actions">
- <strong>Anyone:</strong>
+ <strong><%= _('Anyone:') %></strong>
<ul>
<li>
- <%= link_to "Add an annotation", new_comment_url(:url_title => @info_request.url_title) %> (to help
- the requester or others)
+ <%= _('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_url(:url_title => @info_request.url_title)] %>
</li>
<% if @old_unclassified %>
<li>
- <%= link_to "Update the status of this request", '#describe_state_form_1' %>
+ <%= link_to _('Update the status of this request'), '#describe_state_form_1' %>
</li>
<% end %>
</ul>
</div>
<div id="owner_actions">
- <strong><%=h @info_request.user.name %> only:</strong>
+ <strong><%= _('{{info_request_user_name}} only:',:info_request_user_name=>h(@info_request.user.name)) %></strong>
<ul>
<li>
<% if @last_response.nil? %>
- <%= link_to "Send follow up to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to "Send follow up to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
<% else %>
<% foi_cache(:controller => "request", :action => "show_response", :id => @info_request.id, :incoming_message_id => @last_response.id, :only_path => true, :template => "_after_actions", :section => "reply_to_link") do %>
- <%= link_to "Reply to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
+ <%= link_to "Reply to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
<% end %>
<% end %>
</li>
<% if !@old_unclassified %>
<li>
- <%= link_to "Update the status of this request", request_url(@info_request, :update_status => 1) %>
+ <%= link_to _("Update the status of this request"), request_url(@info_request, :update_status => 1) %>
</li>
<% end %>
<li>
- <%= link_to "Request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
+ <%= link_to _("Request an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
</li>
</ul>
</div>
<div id="public_body_actions">
- <strong><%=h @info_request.public_body.name %> only:</strong>
+ <strong><%= _('{{public_body_name}} only:',:public_body_name=>h(@info_request.public_body.name) ) %> </strong>
<ul>
<li>
- <%= link_to "Respond to request", upload_response_url(:url_title => @info_request.url_title) %>
+ <%= link_to _("Respond to request"), upload_response_url(:url_title => @info_request.url_title) %>
</li>
</ul>
</div>
-
</div>
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
index 090f5a728..4e46347b8 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -24,8 +24,8 @@ if not incoming_message.nil?
<% if !@user.nil? && @user.admin_page_links? %>
<%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
<% end %>
- <%= link_to "Link to this", incoming_message_url(incoming_message) %> |
- <%= link_to "Reply to this message", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>
+ <%= link_to _("Link to this"), incoming_message_url(incoming_message) %> |
+ <%= link_to _("Reply to this message"), show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>
</p>
</div>
@@ -54,8 +54,8 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
<% end %>
-->
- <%= link_to "Link to this", outgoing_message_url(outgoing_message) %> |
- <%= link_to "Send follow up", show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to _("Link to this"), outgoing_message_url(outgoing_message) %> |
+ <%= link_to _("Send follow up"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>
</p>
</div>
<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml
index a91231ae8..f1db6ec18 100644
--- a/app/views/request/_describe_state.rhtml
+++ b/app/views/request/_describe_state.rhtml
@@ -1,64 +1,73 @@
<% if @is_owning_user %>
<% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>
- <h2>What best describes the status of this request now?</h2>
+ <h2><%= _('What best describes the status of this request now?') %></h2>
<hr> <!------------------------------------------------>
<% if @info_request.described_state != 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %>
- <label for="waiting_response<%=id_suffix%>">I'm still <strong>waiting</strong> for my information
- <small>(maybe you got an acknowledgement)</small></label>
+ <label for="waiting_response<%=id_suffix%>"><%= _('I\'m still <strong>waiting</strong> for my information
+ <small>(maybe you got an acknowledgement)</small>') %></label>
</div>
<% end %>
<% if @info_request.described_state == 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "internal_review", :id => 'internal_review' + id_suffix %>
- <label for="internal_review<%=id_suffix%>">I'm still <strong>waiting</strong> for the internal review</label>
+ <label for="internal_review<%=id_suffix%>"><%= _('I\'m still <strong>waiting</strong> for the internal review') %></label>
</div>
<% end %>
<% if @info_request.described_state != 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "waiting_clarification", :id => 'waiting_clarification' + id_suffix %>
- <label for="waiting_clarification<%=id_suffix%>">I've been asked to <strong>clarify</strong> my request</label>
+ <label for="waiting_clarification<%=id_suffix%>"><%= _('I\'ve been asked to <strong>clarify</strong> my request') %></label>
</div>
<% end %>
<% if @update_status && @info_request.described_state != 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "internal_review", :id => 'internal_review' + id_suffix %>
- <label for="internal_review<%=id_suffix%>">I'm waiting for an <strong>internal review</strong> response</label>
+ <label for="internal_review<%=id_suffix%>"><%= _('I\'m waiting for an <strong>internal review</strong> response') %></label>
</div>
<% end %>
<div>
<%= radio_button "incoming_message", "described_state", "gone_postal", :id => 'gone_postal' + id_suffix %>
- <label for="gone_postal<%=id_suffix%>">They are going to reply <strong>by post</strong></label>
+ <label for="gone_postal<%=id_suffix%>"><%= _('They are going to reply <strong>by post</strong>') %></label>
</div>
+ <div>
+ <%= radio_button "incoming_message", "described_state", "deadline_extended", :id => 'deadline_extended' + id_suffix %>
+ <label for="deadline_extended<%=id_suffix%>"><%= _('Authority has requested <strong>extension of the deadline.</strong>') %></label>
+ </div>
<hr> <!------------------------------------------------>
<% if @info_request.described_state == 'internal_review' %>
- <p>The <strong>review has finished</strong> and overall:</p>
+ <p><%= _('The <strong>review has finished</strong> and overall:') %></p>
<% end %>
<div>
<%= radio_button "incoming_message", "described_state", "not_held", :id => 'not_held' + id_suffix %>
- <label for="not_held<%=id_suffix%>">They do <strong>not have</strong> the information <small>(maybe they say who does)</small></label>
+ <label for="not_held<%=id_suffix%>"><%= _('They do <strong>not have</strong> the information <small>(maybe they say who does)</small>') %></label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "partially_successful", :id => 'partially_successful' + id_suffix %>
- <label for="partially_successful<%=id_suffix%>">I've received <strong>some of the information</strong> </label>
+ <label for="partially_successful<%=id_suffix%>"><%= _('I\'ve received <strong>some of the information</strong>') %> </label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "successful", :id => 'successful' + id_suffix %>
- <label for="successful<%=id_suffix%>">I've received <strong>all the information</strong> </label>
+ <label for="successful<%=id_suffix%>"><%= _('I\'ve received <strong>all the information') %></strong> </label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "rejected", :id => 'rejected' + id_suffix %>
- <label for="rejected<%=id_suffix%>">My request has been <strong>refused</strong></label>
+ <label for="rejected<%=id_suffix%>"><%= _('My request has been <strong>refused</strong>') %></label>
+ </div>
+
+ <div>
+ <%= radio_button "incoming_message", "described_state", "wrong_response", :id => 'wrong_response' + id_suffix %>
+ <label for="rejected<%=id_suffix%>"><%= _('Authority has replied but the response <strong>does not correspond to the request</strong>') %></label>
</div>
<hr> <!------------------------------------------------>
@@ -66,7 +75,7 @@
<div>
<%= radio_button "incoming_message", "described_state", "error_message", :id => 'error_message' + id_suffix %>
<label for="error_message<%=id_suffix%>">
- I've received an <strong>error message</strong>
+ <%= _('I\'ve received an <strong>error message</strong>') %>
</label>
</div>
@@ -74,14 +83,14 @@
<div>
<%= radio_button "incoming_message", "described_state", "requires_admin", :id => 'requires_admin' + id_suffix %>
<label for="error_message<%=id_suffix%>">
- This request <strong>requires administrator attention</strong>
+ <%= _('This request <strong>requires administrator attention</strong>') %>
</label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "user_withdrawn", :id => 'user_withdrawn' + id_suffix %>
<label for="user_withdrawn<%=id_suffix%>">
- I would like to <strong>withdraw this request</strong>
+ <%= _('I would like to <strong>withdraw this request</strong>') %>
</label>
</div>
<% end %>
@@ -91,19 +100,15 @@
<p>
<%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
<%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
- <%= submit_tag "Submit status" %> (and we'll suggest <strong>what to do next</strong>)
+ <%= submit_tag _("Submit status") %> (<%= _('and we\'ll suggest <strong>what to do next</strong>') %>)
</p>
<% end %>
<% elsif @old_unclassified %>
<%= render :partial => 'other_describe_state', :locals => {:id_suffix => id_suffix } %>
<% else %>
- We don't know whether the most recent response to this request contains
- information or not
+<%= _('We don\'t know whether the most recent response to this request contains
+ information or not
&ndash;
- if you are
- <%= user_link(@info_request.user) %>,
- please
- <%= link_to "sign in", signin_url(:r => request.request_uri) %>
- and let everyone know.
+ if you are {{user_link}} please <a href="%s">sign in</a> and let everyone know.',:user_link=>user_link(@info_request.user)) % [signin_url(:r => request.request_uri)] %>
<% end %>
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml
index c2be323a2..8c279d234 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.rhtml
@@ -1,54 +1,52 @@
<div id="followup">
<% if @internal_review %>
- <h1>Request an internal review
- from <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
+ <h1><%= _('Request an internal review from') %> <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
</h1>
<% elsif incoming_message.nil? || !incoming_message.valid_to_reply_to? %>
- <h2>Send a public follow up message
- to <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
+ <h2><%= _('Send a public follow up message to') %> <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
</h2>
<% else %>
- <h2>Send a public reply to
+ <h2><%= _('Send a public reply to') %>
<%=h OutgoingMailer.name_for_followup(@info_request, incoming_message) %>
</h2>
<% end %>
<% if @info_request.allow_new_responses_from == 'nobody' %>
- <p>Follow ups and new responses to this request have been stopped to prevent spam. Please
- <a href="/help/contact">contact us</a> if you are <%= user_link(@info_request.user) %>
- and need to send a follow up.</p>
+ <p><%= _('Follow ups and new responses to this request have been stopped to prevent spam. Please
+ <a href="%s">contact us</a> if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user) ) % [help_contact_path] %></p>
<% else %>
<% if @internal_review %>
<p>
- If you are dissatisfied by the response you got from
+ <%= _('If you are dissatisfied by the response you got from
the public authority, you have the right to
- complain (<a href="http://foiwiki.com/foiwiki/index.php/Internal_reviews">details</a>).
+ complain (<a href="%s">details</a>).') % "http://foiwiki.com/foiwiki/index.php/Internal_reviews" %>
</p>
<% end %>
- <p>Please <strong>only</strong> write messages directly relating to your
- request '<%= request_link(@info_request) %>'. If you would like to ask for information
- that was not in your original request, then
- <%= link_to "file a new request", new_request_to_body_url(:url_name => @info_request.public_body.url_name) %>.
+ <p>
+ <%= _('Please <strong>only</strong> write messages directly relating to your
+ request {{request_link}}. If you would like to ask for information
+ that was not in your original request, then <a href="%s">file a new request</a>.',:request_link=>request_link(@info_request)) % [new_request_to_body_url(:url_name => @info_request.public_body.url_name)] %>
</p>
<% status = @info_request.calculate_status %>
<% if status == 'waiting_response_overdue' %>
- <p>The response to your request has been <strong>delayed</strong>. You can say that,
+ <p><%= _('The response to your request has been <strong>delayed</strong>. You can say that,
by law, the authority should normally have responded
- <strong>promptly</strong> and
+ <strong>promptly</strong> and') %>
<% if @info_request.public_body.is_school? %>
- in term time
+ <%= _('in term time') %>
<% end %>
- by <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
- (<%= link_to "details", "/help/requesting#quickly_response" %>).
+ <%= _('by <strong>{{date}}</strong>',:date=>simple_date(@info_request.date_response_required_by)) %>
+ (<%= _('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"] %>).
+
</p>
<% elsif status == 'waiting_response_very_overdue' %>
<p>
- The response to your request is <strong>long overdue</strong>. You can say that, by
+ <%= _('The response to your request is <strong>long overdue</strong>. You can say that, by
law, under all circumstances, the authority should have responded
- by now (<%= link_to "details", "/help/requesting#quickly_response" %>).
+ by now') %> (<%= _('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"] %>).
</p>
<% end %>
@@ -60,7 +58,7 @@
<% if @internal_review %>
<%= hidden_field_tag "outgoing_message[what_doing]", "internal_review" %>
<% else %>
- <h3>What are you doing?</h3>
+ <h3><%= _('What are you doing?') %></h3>
<% if !@outgoing_message.errors[:what_doing_dummy].nil? %>
<div class="fieldWithErrors">
@@ -70,25 +68,25 @@
<!--
<div>
<%= radio_button "outgoing_message", "what_doing", "new_information", :id => "new_information" %>
- <label for="new_information">I am asking for <strong>new information</strong> </label>
+ <label for="new_information"><%= _('I am asking for <strong>new information</strong>') %> </label>
</div>
-->
<div>
<%= radio_button "outgoing_message", "what_doing", "internal_review", :id => "internal_review" %>
- <label for="internal_review">I am requesting an <strong>internal review</strong>
- (<a href="/help/unhappy">what's that?</a>)
+ <label for="internal_review"><%= _('I am requesting an <strong>internal review</strong>') %>
+ <%= _('<a href="%s">what\'s that?</a>') % ["/help/unhappy"] %>
</label>
</div>
<div>
<%= radio_button "outgoing_message", "what_doing", "normal_sort", :id => "sort_normal" %>
- <label for="sort_normal"><strong>Anything else</strong>, such as clarifying, prompting, thanking</label>
+ <label for="sort_normal"><%= _('<strong>Anything else</strong>, such as clarifying, prompting, thanking') %></label>
</div>
</div>
<% end %>
<% if @internal_review %>
- <p>Edit and add <strong>more details</strong> to the message above,
- explaining why you are dissatisfied with their response.
+ <p><%= _('Edit and add <strong>more details</strong> to the message above,
+ explaining why you are dissatisfied with their response.') %>
</p>
<% end %>
@@ -98,7 +96,7 @@
<% if @internal_review_pass_on %>
<%= hidden_field_tag(:internal_review, 1 ) %>
<% end %>
- <%= submit_tag "Preview your message" %>
+ <%= submit_tag _("Preview your message") %>
</p>
<% end %>
diff --git a/app/views/request/_hidden_correspondence.rhtml b/app/views/request/_hidden_correspondence.rhtml
index 2c168c3fb..0ea6fcddd 100644
--- a/app/views/request/_hidden_correspondence.rhtml
+++ b/app/views/request/_hidden_correspondence.rhtml
@@ -6,26 +6,22 @@
if not incoming_message.nil?
%>
<div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">
- <p>This response has been hidden. See annotations to find out why.
- If you are the requester, then you may
- <%= link_to "sign in", signin_url(:r => request.request_uri) %>
- to view the response.
+ <p>
+ <%= _('This response has been hidden. See annotations to find out why.
+ If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)] %>
</p>
</div>
<% elsif [ 'sent', 'followup_sent', 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
<div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
- <p>This outgoing message has been hidden. See annotations to
- find out why. If you are the requester, then you may <%= link_to
- "sign in", signin_url(:r => request.request_uri) %> to view the
- response.
+ <p>
+ <%= _('This outgoing message has been hidden. See annotations to
+ find out why. If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)] %>
</p>
</div>
<% elsif info_request_event.event_type == 'comment' %>
<div class="comment_in_request" id="comment-<%=comment.id.to_s%>">
- <p>This comment has been hidden. See annotations to
- find out why. If you are the requester, then you may <%= link_to
- "sign in", signin_url(:r => request.request_uri) %> to view the
- response.
+ <p><%= _('This comment has been hidden. See annotations to
+ find out why. If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)]%>
</p>
</div>
<% end %>
@@ -33,5 +29,5 @@
<% elsif info_request_event.prominence == 'hidden' %>
<% # show nothing when hidden %>
<% else %>
- <% raise "unexpected prominence on request event" %>
+ <% raise _("unexpected prominence on request event") %>
<% end %>
diff --git a/app/views/request/_other_describe_state.rhtml b/app/views/request/_other_describe_state.rhtml
index 66f64c27a..7bd4bf7ea 100644
--- a/app/views/request/_other_describe_state.rhtml
+++ b/app/views/request/_other_describe_state.rhtml
@@ -1,60 +1,60 @@
<% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>
- <h2>Hi! We need your help. The person who made the following request
- hasn't told us whether or not it was successful. Would you mind taking
+ <h2><%= _('Hi! We need your help. The person who made the following request
+ hasn\'t told us whether or not it was successful. Would you mind taking
a moment to read it and help us keep the place tidy for everyone?
- Thanks.</h2>
+ Thanks.') %></h2>
<hr> <!------------------------------------------------>
<% if @info_request.described_state != 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %>
- <label for="waiting_response<%=id_suffix%>"><strong>No response</strong> has been received
- <small>(maybe there's just an acknowledgement)</small></label>
+ <label for="waiting_response<%=id_suffix%>"><%= _('<strong>No response</strong> has been received
+ <small>(maybe there\'s just an acknowledgement)</small>') %></label>
</div>
<% end %>
<% if @info_request.described_state == 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "internal_review", :id => 'internal_review' + id_suffix %>
- <label for="internal_review<%=id_suffix%>">Still awaiting an <strong>internal review</strong></label>
+ <label for="internal_review<%=id_suffix%>"><%= _('Still awaiting an <strong>internal review</strong>') %></label>
</div>
<% end %>
<% if @info_request.described_state != 'internal_review' %>
<div>
<%= radio_button "incoming_message", "described_state", "waiting_clarification", :id => 'waiting_clarification' + id_suffix %>
- <label for="waiting_clarification<%=id_suffix%>"><strong>Clarification</strong> has been requested</label>
+ <label for="waiting_clarification<%=id_suffix%>"><%= _('<strong>Clarification</strong> has been requested') %></label>
</div>
<% end %>
<div>
<%= radio_button "incoming_message", "described_state", "gone_postal", :id => 'gone_postal' + id_suffix %>
- <label for="gone_postal<%=id_suffix%>">A response will be sent <strong>by post</strong></label>
+ <label for="gone_postal<%=id_suffix%>"><%= _('A response will be sent <strong>by post</strong>') %></label>
</div>
<hr> <!------------------------------------------------>
<% if @info_request.described_state == 'internal_review' %>
- <p>The <strong>review has finished</strong> and overall:</p>
+ <p><%= _('The <strong>review has finished</strong> and overall:') %></p>
<% end %>
<div>
<%= radio_button "incoming_message", "described_state", "not_held", :id => 'not_held' + id_suffix %>
- <label for="not_held<%=id_suffix%>">The authority do <strong>not have</strong> the information <small>(maybe they say who does)</small></label>
+ <label for="not_held<%=id_suffix%>"><%= _('The authority do <strong>not have</strong> the information <small>(maybe they say who does)') %></small></label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "partially_successful", :id => 'partially_successful' + id_suffix %>
- <label for="partially_successful<%=id_suffix%>"><strong>Some of the information</strong> has been sent </label>
+ <label for="partially_successful<%=id_suffix%>"><%= _('<strong>Some of the information</strong> has been sent ') %></label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "successful", :id => 'successful' + id_suffix %>
- <label for="successful<%=id_suffix%>"><strong>All the information</strong> has been sent</label>
+ <label for="successful<%=id_suffix%>"><%= _('<strong>All the information</strong> has been sent') %></label>
</div>
<div>
<%= radio_button "incoming_message", "described_state", "rejected", :id => 'rejected' + id_suffix %>
- <label for="rejected<%=id_suffix%>">The request has been <strong>refused</strong></label>
+ <label for="rejected<%=id_suffix%>"><%= _('The request has been <strong>refused</strong>') %></label>
</div>
<hr> <!------------------------------------------------>
@@ -62,7 +62,7 @@
<div>
<%= radio_button "incoming_message", "described_state", "error_message", :id => 'error_message' + id_suffix %>
<label for="error_message<%=id_suffix%>">
- An <strong>error message</strong> has been received
+ <%= _('An <strong>error message</strong> has been received') %>
</label>
</div>
diff --git a/app/views/request/_request_listing.rhtml b/app/views/request/_request_listing.rhtml
index ebfbc60a4..492f874f3 100644
--- a/app/views/request/_request_listing.rhtml
+++ b/app/views/request/_request_listing.rhtml
@@ -1,5 +1,5 @@
<% if info_requests.empty? %>
- None found.
+ <%= _('None found.') %>
<% else %>
<% for info_request in info_requests %>
<%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %>
diff --git a/app/views/request/_request_listing_short_via_event.rhtml b/app/views/request/_request_listing_short_via_event.rhtml
index 7cc86a684..cc2a5a162 100644
--- a/app/views/request/_request_listing_short_via_event.rhtml
+++ b/app/views/request/_request_listing_short_via_event.rhtml
@@ -5,8 +5,9 @@ end %>
<div class="request_short_listing">
<h3><%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %></h3>
<p>
- To <%= public_body_link_absolute(info_request.public_body) %>
- by <%= user_link_absolute(info_request.user) %>,
+
+<%= _('To {{public_body_link_absolute}}',:public_body_link_absolute => public_body_link_absolute(info_request.public_body))%>
+<%= _('by {{user_link_absolute}}',:user_link_absolute => user_link_absolute(info_request.user))%>
<%= simple_date(info_request.created_at) %>
</p>
</div>
diff --git a/app/views/request/_request_listing_single.rhtml b/app/views/request/_request_listing_single.rhtml
index 0f6bf33ec..a300010cd 100644
--- a/app/views/request/_request_listing_single.rhtml
+++ b/app/views/request/_request_listing_single.rhtml
@@ -9,9 +9,7 @@
<strong>
<%= info_request.display_status %>
</strong><br>
- Requested from <%= public_body_link(info_request.public_body) %>
- by <%= user_link(info_request.user) %>
- on <%= simple_date(info_request.created_at) %>.
+ <%= _('Requested from {{public_body_name}} by {{info_request_user}} on {{date}}',:public_body_name=>public_body_link(info_request.public_body),:info_request_user=>user_link(info_request.user),:date=>simple_date(info_request.created_at)) %>
</span>
</div>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index 831ab5836..afacabea5 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -25,26 +25,17 @@ end %>
</strong><br>
<% if event.event_type == 'sent' %>
- Request sent to <%= public_body_link_absolute(info_request.public_body) %>
- by <%= user_link_absolute(info_request.user) %>
- on <%= simple_date(event.created_at) %>.
+ <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'followup_sent' %>
<%=event.display_status %>
- sent to <%= public_body_link_absolute(info_request.public_body) %>
- by <%= user_link_absolute(info_request.user) %>
- on <%= simple_date(event.created_at) %>.
+ <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'response' %>
<%=event.display_status %>
- by <%= public_body_link_absolute(info_request.public_body) %>
- to <%= user_link_absolute(info_request.user) %>
- on <%= simple_date(event.created_at) %>.
+ <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'comment' %>
- Request to <%= public_body_link_absolute(info_request.public_body) %>
- by <%= user_link_absolute(info_request.user) %>.
- Annotated by <%= user_link_absolute(event.comment.user) %>
- on <%= simple_date(event.created_at) %>.
+ <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
<% else %>
- <% raise "unknown event type indexed " + event.event_type %>
+ <% raise _("unknown event type indexed ") + event.event_type %>
<% end %>
</span>
</div>
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index 12d1e315b..10be34ab9 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -1,8 +1,8 @@
<div id="request_sidebar">
- <h2>Track this request</h2>
+ <h2><%= _('Track this request') %></h2>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>
- <h2>Act on what you've learnt</h2>
+ <h2><%= _("Act on what you've learnt") %></h2>
<div class="act_link">
<%= link_to '<img src="/images/helpmeinvestigate.png" alt="" class="rss">', "http://helpmeinvestigate.com/"%>
<%= link_to 'Get help investigating', "http://helpmeinvestigate.com/"%>
@@ -27,7 +27,7 @@
<% view_cache :ttl => 1.day, :tag => ['similar', @info_request.id] do %>
<% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>
- <h2>Similar requests</h2>
+ <h2><% _('Similar requests')%></h2>
<% for result in @xapian_similar.results %>
<%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
@@ -38,11 +38,11 @@
<% end %>
<% end %>
- <p><%= link_to "Event history details", request_details_url(@info_request) %></p>
+ <p><%= link_to _('Event history details'), request_details_url(@info_request) %></p>
<!-- this link with this wording is here for legal reasons, discuss with
board and our lawyer before changing or removing it -->
- <p><small><a href="/help/officers#copyright">Are you the owner of
- any commercial copyright on this page?</a></small></p>
+ <p><small><%= _('<a href="%s">Are you the owner of
+ any commercial copyright on this page?</a>') % [help_officers_path+"#copyright"] %></small></p>
</div>
diff --git a/app/views/request/_sidebar_request_listing.rhtml b/app/views/request/_sidebar_request_listing.rhtml
index e9aeb4f73..ec5a5813d 100644
--- a/app/views/request/_sidebar_request_listing.rhtml
+++ b/app/views/request/_sidebar_request_listing.rhtml
@@ -10,7 +10,7 @@
<strong>
<%= info_request.display_status %>
</strong><br>
- Requested on <%= simple_date(info_request.created_at) %>.
+ <% _('Requested on {{date}}',:date=>simple_date(info_request.created_at)) %>.
</span>
</div>
<% end %>
diff --git a/app/views/request/_view_html_prefix.rhtml b/app/views/request/_view_html_prefix.rhtml
index 486b62d5d..f425735cd 100644
--- a/app/views/request/_view_html_prefix.rhtml
+++ b/app/views/request/_view_html_prefix.rhtml
@@ -3,10 +3,10 @@
<a href="/"><img src="/images/navimg/logo-trans-small.png" alt="WhatDotheyKnow?"></a>
</div>
<div class="view_html_download_link">
- <%=link_to "Download original attachment", @attachment_url %>
+ <%=link_to _("Download original attachment"), @attachment_url %>
<br>(<%=h @attachment.name_of_content_type %>)
</div>
- This is an HTML version of an attachment to the Freedom of Information request
+ <%= _('This is an HTML version of an attachment to the Freedom of Information request')%>
'<%=link_to h(@info_request.title), incoming_message_url(@incoming_message)%>'.
</div>
diff --git a/app/views/request/details.rhtml b/app/views/request/details.rhtml
index 03e5148ef..94d87306d 100644
--- a/app/views/request/details.rhtml
+++ b/app/views/request/details.rhtml
@@ -1,20 +1,20 @@
-<% @title = "Details of request '" + h(@info_request.title) + "'" %>
-<h1><%="Details of request '" + request_link(@info_request) + "'" %></h1>
+<% @title = _("Details of request '") + h(@info_request.title) + "'" %>
+<h1><%= _("Details of request '") + request_link(@info_request) + "'" %></h1>
-<h2>Event history</h2>
+<h2><%= _('Event history') %></h2>
-<p>This table shows the technical details of the internal events that happened
+<p><%= _('This table shows the technical details of the internal events that happened
to this request on WhatDoTheyKnow. This could be used to generate information about
the speed with which authorities respond to requests, the number of requests
-which require a postal response and much more.
+which require a postal response and much more.') %>
</p>
-<p><strong>Caveat emptor!</strong> To use this data in an honourable way, you will need
+<p><%= _('<strong>Caveat emptor!</strong> To use this data in an honourable way, you will need
a good internal knowledge of user behaviour on WhatDoTheyKnow. How,
why and by whom requests are categorised is not straightforward, and there will
be user error and ambiguity. You will also need to understand FOI law, and the
-way authorities use it. Plus you'll need to be an elite statistician. Please
-<a href="/help/contact">contact us</a> with questions.
+way authorities use it. Plus you\'ll need to be an elite statistician. Please
+<a href="%s">contact us</a> with questions.') % [help_contact_path] %>
</p>
<% columns = ['id', 'event_type', 'created_at', 'described_state', 'calculated_state', 'last_described_at' ] %>
@@ -46,10 +46,14 @@ way authorities use it. Plus you'll need to be an elite statistician. Please
<% end %>
</table>
-<p>Here <strong>described</strong> means when a user selected a status for the request, and
+<p>
+<%= _('Here <strong>described</strong> means when a user selected a status for the request, and
the most recent event had its status updated to that value. <strong>calculated</strong> is then inferred by
-WhatDoTheyKnow for intermediate events, which weren't given an explicit
-description by a user. See the <a href="/search">search tips</a> for description of the states.</p>
+WhatDoTheyKnow for intermediate events, which weren\'t given an explicit
+description by a user. See the <a href="%s">search tips</a> for description of the states.') % [search_redirect_path] %>
+</p>
-<p>You can get this page in computer-readable format as part of the main JSON
-page for the request. See the <a href="/help/api">API documentation</a>.</p>
+<p>
+<%= _('You can get this page in computer-readable format as part of the main JSON
+page for the request. See the <a href="%s">API documentation</a>.') % [help_api_path] %>
+</p>
diff --git a/app/views/request/followup_bad.rhtml b/app/views/request/followup_bad.rhtml
index f3e9f07d7..306eddd10 100644
--- a/app/views/request/followup_bad.rhtml
+++ b/app/views/request/followup_bad.rhtml
@@ -1,32 +1,31 @@
<% if @incoming_message.nil? || !@incoming_message.valid_to_reply_to? %>
- <% @title = "Unable to send follow up message to " + OutgoingMailer.name_for_followup(@info_request, nil) %>
+ <% @title = _("Unable to send follow up message to {{username}}",:username=>OutgoingMailer.name_for_followup(@info_request, nil)) %>
<% else %>
- <% @title = "Unable to send a reply to " + OutgoingMailer.name_for_followup(@info_request, @incoming_message) %>
+ <% @title = _("Unable to send a reply to {{username}}",:username=>OutgoingMailer.name_for_followup(@info_request, @incoming_message)) %>
<% end %>
<h1><%=@title%></h1>
<% if @reason == 'not_apply' %>
<!-- we should never get here, but just in case give a sensible message -->
- <p>Freedom of Information law no longer applies to <%=h @info_request.public_body.name %>.
- From the request page, try replying to a particular message, rather than sending
+ <p><%= _('Freedom of Information law no longer applies to') %> <%=h @info_request.public_body.name %>.
+ <%= _('From the request page, try replying to a particular message, rather than sending
a general followup. If you need to make a general followup, and know
- an email which will go to the right place, please <a href="/help/contact">send it to us</a>.
+ an email which will go to the right place, please <a href="%s">send it to us</a>.') % [help_contact_path] %>
</p>
<% elsif @reason == 'defunct' %>
<!-- we should never get here, but just in case give a sensible message -->
- <p><%=h @info_request.public_body.name %> no longer exists. If you are trying to make
+ <p><%=h @info_request.public_body.name %> <%= _('no longer exists. If you are trying to make
From the request page, try replying to a particular message, rather than sending
a general followup. If you need to make a general followup, and know
- an email which will go to the right place, please <a href="/help/contact">send it to us</a>.
+ an email which will go to the right place, please <a href="%s">send it to us</a>.') % [help_contact_path] %>
</p>
<% elsif @reason == 'bad_contact' %>
- <p>We do not have a working <%=h @info_request.law_used_full %>
- address for <%=h @info_request.public_body.name %>. You may be able to find
+ <p><%= _('We do not have a working {{law_used_full}} address for {{public_body_name}}.',:law_used_full=>h(@info_request.law_used_full),:public_body_name=>h(@info_request.public_body.name)) %> <%= _('You may be able to find
one on their website, or by phoning them up and asking. If you manage
- to find one, then please <a href="/help/contact">send it to us</a>.
+ to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path] %>
</p>
<% else %>
- <% raise "unknown reason " + @reason %>
+ <% raise _("unknown reason ") + @reason %>
<% end %>
diff --git a/app/views/request/followup_preview.rhtml b/app/views/request/followup_preview.rhtml
index f711575a8..50c64138f 100644
--- a/app/views/request/followup_preview.rhtml
+++ b/app/views/request/followup_preview.rhtml
@@ -1,26 +1,26 @@
-<% @title = "Preview follow up to '" + h(@info_request.public_body.name) + "'" %>
+<% @title = _("Preview follow up to '") + h(@info_request.public_body.name) + "'" %>
<div id="followup">
<% form_for(:outgoing_message, @outgoing_message, :html => { :id => 'preview_form' }, :url => (@incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => @incoming_message.id)) + "#followup" ) do |o| %>
<% if @internal_review %>
- <h1>Now preview your message asking for an internal review</h1>
+ <h1><%= _('Now preview your message asking for an internal review') %></h1>
<% else %>
- <h1>Now preview your follow up</h1>
+ <h1><%= _('Now preview your follow up') %></h1>
<% end %>
<ul>
- <li>Check you haven't included any <strong>personal information</strong>.</li>
- <li>Your message will appear in <strong>search engines</strong></li>
+ <li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li>
+ <li><%= _('Your message will appear in <strong>search engines</strong>') %></li>
</ul>
<% fields_for :outgoing_message do |o| %>
<div class="correspondence" id="outgoing-0">
<p class="preview_subject">
- <strong>To:</strong> <%=h OutgoingMailer.name_for_followup(@info_request, @incoming_message) %>
- <br><strong>Subject:</strong> <%=h OutgoingMailer.subject_for_followup(@info_request, @outgoing_message) %>
+ <strong><%= _('To:') %></strong> <%=h OutgoingMailer.name_for_followup(@info_request, @incoming_message) %>
+ <br><strong><%= _('Subject:') %></strong> <%=h OutgoingMailer.subject_for_followup(@info_request, @outgoing_message) %>
</p>
<div class="correspondence_text">
@@ -34,8 +34,8 @@
<% end %>
<p>
- <strong>Privacy warning:</strong> Your message, and any response
- to it, will be displayed publicly on this website.
+ <%= _('<strong>Privacy warning:</strong> Your message, and any response
+ to it, will be displayed publicly on this website.') %>
<%= o.hidden_field(:what_doing) %>
</p>
@@ -46,8 +46,8 @@
<% if @internal_review_pass_on %>
<%= hidden_field_tag(:internal_review, 1 ) %>
<% end %>
- <%= submit_tag "Re-edit this message", :name => 'reedit' %>
- <%= submit_tag "Send message", :name => 'submit' %>
+ <%= submit_tag _("Re-edit this message"), :name => 'reedit' %>
+ <%= submit_tag _("Send message"), :name => 'submit' %>
</p>
<% end %>
diff --git a/app/views/request/hidden.rhtml b/app/views/request/hidden.rhtml
index 0dcd66cb4..a4afb63c6 100644
--- a/app/views/request/hidden.rhtml
+++ b/app/views/request/hidden.rhtml
@@ -1,4 +1,4 @@
-<% @title = "Request has been removed" %>
+<% @title = _("Request has been removed") %>
<h1><%=@title%></h1>
@@ -6,16 +6,13 @@
<%=@details%>
</p>
-<p>The request you have tried to view has been removed. There are
-various reasons why we might have done this, sorry we can't
-be more specific here. Please <a
- href="/help/contact">contact us</a> if you have any questions.
+<p><%= _('The request you have tried to view has been removed. There are
+various reasons why we might have done this, sorry we can\'t be more specific here. Please <a
+ href="%s">contact us</a> if you have any questions.') % [help_contact_path] %>
</p>
<% if @info_request.prominence == 'requester_only' %>
<p>
- If you are the requester, then you may
- <%= link_to "sign in", signin_url(:r => request.request_uri) %>
- to view the request.
+ <%= _('If you are the requester, then you may <a href="%s">sign in</a> to view the request.') % [signin_url(:r => request.request_uri)] %>
</p>
<% end %>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index 90e5f4605..9e12b4175 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -1,9 +1,9 @@
<div id="list_sidebar">
-<h1>Show only...</h1>
+<h1><%= _('Show only...')%></h1>
<ul>
<% for view, description, target in [
- ['successful', "Successful responses", request_list_successful_url(:view => 'successful')],
- ['recent', "Recently sent requests", request_list_recent_url(:view => 'recent')]
+ ['successful', _('Successful responses'), request_list_successful_url(:view => 'successful')],
+ ['recent', _('Recently sent requests'), request_list_recent_url(:view => 'recent')]
] %>
<li>
<%= link_to_unless (@view == view), description, target %>
@@ -20,13 +20,13 @@
<% view_cache :ttl => 5.minutes, :tag => [@view, @page] do %>
<% if @list_results.empty? %>
- <p>No requests of this sort yet.</p>
+ <p> <%= _('No requests of this sort yet.')%></p>
<% else %>
<% for result in @list_results%>
<% if result.class.to_s == 'InfoRequestEvent' %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
<% else %>
- <p><strong>Unexpected search result type <%=result.class.to_s%></strong></p>
+ <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p>
<% end %>
<% end %>
<% end %>
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml
index e9e89aa5d..a97116aa3 100644
--- a/app/views/request/new.rhtml
+++ b/app/views/request/new.rhtml
@@ -1,12 +1,11 @@
-<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>
+<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %>
<% if @existing_request %>
<div class="errorExplanation" id="errorExplanation"><ul>
<li>
- <%= user_or_you_capital_link(@existing_request.user) %> already
- created the same request on <%=simple_date(@existing_request.created_at)%>.
- You can either view the <a href="<%=request_url(@existing_request)%>">existing request</a>,
- or edit the details below to make a new but similar request.
+ <%= _('{{existing_request_user}} already
+ created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
+ or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_url(@existing_request)) %>
</li>
</ul></div>
<% end %>
@@ -14,75 +13,71 @@
<%= foi_error_messages_for :info_request, :outgoing_message %>
<div id="request_advice">
- <h1>Read this before writing your <%=h(@info_request.law_used_full)%> request</h1>
+ <h1><%= _('Read this before writing your {{info_request_law_used_full}} request', :info_request_law_used_full=>h(@info_request.law_used_full)) %></h1>
<ul>
<li>
<% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>
<p>
- First,
+ <%= _('First,') %>
<% if !@info_request.public_body.publication_scheme.empty? %>
- <strong>browse</strong> the authority's
- <%= link_to "publication scheme", @info_request.public_body.publication_scheme %>
- or <strong>search</strong> their web site ...
+ <%= _('<strong>browse</strong> the authority\'s <a href="%s">publication scheme</a> or <strong>search</strong> their web site ...') % [@info_request.public_body.publication_scheme] %>
<% else %>
- <strong>search</strong> the authority's web site ...
+ <%= _('<strong>search</strong> the authority\'s web site ...') %>
<% end %>
<% if !@info_request.public_body.calculated_home_page.nil? %>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; <%= text_field_tag 'q', params[:q], { :size => 20 } %>
<%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
- <%= submit_tag "Search" %>
+ <%= submit_tag _("Search") %>
<% end %>
<br>
- ... to check that the info isn't already published.
+ ... <%= _('to check that the info isn\'t already published.') %>
</p>
<% end %>
</li>
<li>
<% if @info_request.public_body.info_requests.size > 0 %>
- Browse <%= link_to "other requests", public_body_url(@info_request.public_body) %>
- to '<%= h(@info_request.public_body.name) %>'
- for examples of how to word your request.
+ <%= _("Browse <a href='%s'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name)) % [public_body_url(@info_request.public_body)] %>
<% else %>
- Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.
+ <%= _('Browse <a href="%s">other requests</a> for examples of how to word your request.') % [request_list_url] %>
<% end %>
</li>
- <li>Write your request in <strong>simple, precise language</strong>.</li>
- <li>Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.</li>
- <li>Keep it <strong>focused</strong>, you'll be more likely to get what you want (<a href="/help/requesting#focused">why?</a>).</li>
- <li>This site is <strong>public</strong>. Everything you type and any response will be published.</li>
+ <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
+ <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li>
+ <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li>
+ <li><%= _('This site is <strong>public</strong>. Everything you type and any response will be published.') %></li>
</ul>
<% if @info_request.public_body.has_notes? %>
- <h1>Special note for this authority!</h1>
+ <h1><%= _('Special note for this authority!') %></h1>
<ul>
<li><p><%= @info_request.public_body.notes_as_html %></p></li>
</ul>
<% end %>
<% if @info_request.public_body.eir_only? %>
- <h1>Please ask for environmental information only</h1>
+ <h1><%= _('Please ask for environmental information only') %></h1>
- <p>The Freedom of Information Act <strong>does not apply</strong> to <%=h(@info_request.public_body.name)%>.
- However, you have the right to request environmental
- information under a different law (<a href="/help/requesting#eir">explanation</a>).
- This covers a very wide spectrum of information about the state of
- the <strong>natural and built environment</strong>, such as:
+ <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
+ <%= _('However, you have the right to request environmental
+ information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
+ <%= _('This covers a very wide spectrum of information about the state of
+ the <strong>natural and built environment</strong>, such as:') %>
<ul>
- <li>Air, water, soil, land, flora and fauna (including how these effect
- human beings)</li>
- <li>Information on emissions and discharges (e.g. noise, energy,
- radiation, waste materials)</li>
- <li>Human health and safety</li>
- <li>Cultural sites and built structures (as they may be affected by the
- environmental factors listed above)</li>
- <li>Plans and administrative measures that affect these matters</li>
+ <li><%= _('Air, water, soil, land, flora and fauna (including how these effect
+ human beings)') %></li>
+ <li><%= _('Information on emissions and discharges (e.g. noise, energy,
+ radiation, waste materials)') %></li>
+ <li><%= _('Human health and safety') %></li>
+ <li><%= _('Cultural sites and built structures (as they may be affected by the
+ environmental factors listed above)') %></li>
+ <li><%= _('Plans and administrative measures that affect these matters') %></li>
</ul>
- <p>Please only request information that comes under those categories, <strong>do not waste your
- time</strong> or the time of the public authority by requesting unrelated information.</p>
+ <p><%= _('Please only request information that comes under those categories, <strong>do not waste your
+ time</strong> or the time of the public authority by requesting unrelated information.') %></p>
<% end %>
</div>
@@ -90,58 +85,58 @@
<div id="request_form">
<h1>
- <label class="form_label" for="info_request_public_body_id">To:</label>
+ <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label>
<span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
</h1>
<p>
- <label class="form_label" for="info_request_title">Summary:</label>
+ <label class="form_label" for="info_request_title"><%= _('Summary:') %></label>
<%= f.text_field :title, :size => 50 %>
</p>
<div class="form_item_note">
- (a one line summary of the information you are requesting,
- e.g.
+ (<%= _('a one line summary of the information you are requesting,
+ e.g.') %>
<% if @info_request.law_used == 'eir' %>
- 'Pollution levels over time for the River Tyne'
+ <%= _("'Pollution levels over time for the River Tyne'") %>
<% else %>
- 'Crime statistics by ward level for Wales'
+ <%= _("'Crime statistics by ward level for Wales'") %>
<% end %>
)
</div>
<% fields_for :outgoing_message do |o| %>
<p>
- <label class="form_label" for="outgoing_message_body">Your request:</label>
+ <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
<%= o.text_area :body, :rows => 20, :cols => 60 %>
</p>
<% end %>
<% if !@user %>
<p class="form_note">
- Everything that you enter on this page, including <strong>your name</strong>,
+ <%= _('Everything that you enter on this page, including <strong>your name</strong>,
will be <strong>displayed publicly</strong> on
- this website forever (<a href="/help/privacy#public_request">why?</a>).
- If you are thinking of using a pseudonym,
- please <a href="/help/privacy#real_name">read this first</a>.
+ this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"] %>
+ <%= _('If you are thinking of using a pseudonym,
+ please <a href="%s">read this first</a>.') % [help_privacy_path+"#public_request"] %>
</p>
<% else %>
<p class="form_note">
- Everything that you enter on this page
+ <%= _('Everything that you enter on this page
will be <strong>displayed publicly</strong> on
- this website forever (<a href="/help/privacy#public_request">why?</a>).
+ this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"] %>
</p>
<% end %>
<p class="form_note">
- <strong>Can I request information about myself?</strong>
- <a href="/help/requesting#data_protection">No! (Click here for details)</a>
+ <%= _('<strong> Can I request information about myself?</strong>
+ <a href="%s">No! (Click here for details)</a>') % [help_requesting_path+"#data_protection"] %>
</p>
<div class="form_button">
<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
<%= hidden_field_tag(:submitted_new_request, 1 ) %>
<%= hidden_field_tag(:preview, 1 ) %>
- <%= submit_tag "Preview your public request" %>
+ <%= submit_tag _("Preview your public request") %>
</div>
<% if !@info_request.tag_string.empty? %>
diff --git a/app/views/request/new_bad_contact.rhtml b/app/views/request/new_bad_contact.rhtml
index 86dac9899..41a2cef4d 100644
--- a/app/views/request/new_bad_contact.rhtml
+++ b/app/views/request/new_bad_contact.rhtml
@@ -1,10 +1,10 @@
-<% @title = "Missing contact details for '" + h(@info_request.public_body.name) + "'" %>
+<% @title = _("Missing contact details for '") + h(@info_request.public_body.name) + "'" %>
<h1><%=@title%></h1>
-<p>Unfortunately, we do not have a working <%=h @info_request.law_used_full %>
-address for <%=h @info_request.public_body.name %>. You may be able to find
+<p><%= _('Unfortunately, we do not have a working {{info_request_law_used_full}}
+address for'),:info_request_law_used_full => @info_request.law_used_full %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find
one on their website, or by phoning them up and asking. If you manage
-to find one, then please <a href="/help/contact">send it to us</a>.
+to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path] %>
</p>
diff --git a/app/views/request/new_please_describe.rhtml b/app/views/request/new_please_describe.rhtml
index 932731e37..ce80f51f0 100644
--- a/app/views/request/new_please_describe.rhtml
+++ b/app/views/request/new_please_describe.rhtml
@@ -2,8 +2,8 @@
<h1><%=@title%></h1>
-<p>Please select each of these requests in turn, and <strong>let everyone know</strong>
-if they are successful yet or not.
+<p><%= _('Please select each of these requests in turn, and <strong>let everyone know</strong>
+if they are successful yet or not.') %>
</p>
<ul>
@@ -13,13 +13,11 @@ if they are successful yet or not.
</ul>
<p>
- When you're done, <strong>come back here</strong>,
- <%= link_to "reload this page", request.request_uri %>
- and file your new request.
+ <%= _('When you\'re done, <strong>come back here</strong>, <a href="%s">reload this page</a> and file your new request.') % [request.request_uri] %>
</p>
<p>
- Thanks very much for helping keep everything <strong>neat and organised</strong>.
- We'll also, if you need it, give you advice on what to do next about each of your
- requests.
+ <%= _('Thanks very much for helping keep everything <strong>neat and organised</strong>.
+ We\'ll also, if you need it, give you advice on what to do next about each of your
+ requests.') %>
</p>
diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml
index 8c651bb36..6f6ecb2f9 100644
--- a/app/views/request/preview.rhtml
+++ b/app/views/request/preview.rhtml
@@ -2,11 +2,11 @@
<% form_for(:info_request, @info_request, :html => { :id => 'preview_form' } ) do |f| %>
- <h1>Now preview your request</h1>
+ <h1><%= _('Now preview your request') %></h1>
<ul>
- <li>Check you haven't included any <strong>personal information</strong>.</li>
- <li>Your name, request and any responses will appear in <strong>search engines</strong>
- (<a href="/help/privacy#public_request">details</a>).
+ <li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li>
+ <li><%= _('Your name, request and any responses will appear in <strong>search engines</strong>
+ (<a href="%s">details</a>).') % [help_privacy_path+"#public_request"] %>
</li>
</ul>
@@ -14,8 +14,8 @@
<div class="correspondence" id="outgoing-0">
<p class="preview_subject">
- <strong>To:</strong> <%=h @info_request.public_body.name %>
- <br><strong>Subject:</strong> <%=h @info_request.email_subject_request %>
+ <strong><%= _('To:') %></strong> <%=h @info_request.public_body.name %>
+ <br><strong><%= _('Subject:') %></strong> <%=h @info_request.email_subject_request %>
</p>
<div class="correspondence_text">
@@ -28,8 +28,8 @@
</div>
<% end %>
- <p><strong>Privacy note:</strong> If you want to request private information about
- yourself then <a href="/help/requesting#data_protection">click here</a>.
+ <p><%= _('<strong>Privacy note:</strong> If you want to request private information about
+ yourself then <a href="%s">click here</a>.') % [help_requesting_path+"#data_protection"] %>
<p>
<%= f.hidden_field(:title) %>
@@ -37,12 +37,12 @@
<%= f.hidden_field(:tag_string) %>
<%= hidden_field_tag(:submitted_new_request, 1) %>
<%= hidden_field_tag(:preview, 0 ) %>
- <%= submit_tag "Re-edit this request", :name => 'reedit' %>
- <%= submit_tag "Send public " + h(@info_request.law_used_full) + " request", :name => 'submit' %>
+ <%= submit_tag _("Re-edit this request"), :name => 'reedit' %>
+ <%= submit_tag _("Send public ") + h(@info_request.law_used_full) + " request", :name => 'submit' %>
</p>
<% if !@info_request.tag_string.empty? %>
- <p><strong>Tags:</strong> <%=h @info_request.tag_string %></p>
+ <p><strong><%= _('Tags:') %></strong> <%=h @info_request.tag_string %></p>
<% end %>
<% end %>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index a092ac90a..af1d1b6d2 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -2,14 +2,14 @@
<% if @info_request.prominence == 'hidden' %>
<p id="hidden_request">
- This request has prominence 'hidden'. You can only see it because you are logged
- in as a super user.
+ <%= _('This request has prominence \'hidden\'. You can only see it because you are logged
+ in as a super user.') %>
</p>
<% end %>
<% if @info_request.prominence == 'requester_only' %>
<p id="hidden_request">
- This request is hidden, so that only you the requester can see it. Please
- <a href="/help/contact">contact us</a> if you are not sure why.
+ <%= _('This request is hidden, so that only you the requester can see it. Please
+ <a href="%s">contact us</a> if you are not sure why.') % [help_requesting_path] %>
</p>
<% end %>
@@ -32,96 +32,89 @@
<% end %>
<p class="subtitle">
- <%= user_link(@info_request.user) %>
- <% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to "admin", user_admin_url(@info_request.user) %>)
- <% end %>
- made this
- <%=h @info_request.law_used_full%> request
- <% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to "admin", request_admin_url(@info_request) %>)
- <% end %>
- to
- <%= public_body_link(@info_request.public_body) %>
- <% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to "admin", public_body_admin_url(@info_request.public_body) %>)
- <% end %>
+ <%= _('{{user}} made this {{law_used_full}} request',:user=>user_link(@info_request.user), :law_used_full=>h(@info_request.law_used_full)) %>
+ <% if !@user.nil? && @user.admin_page_links? %>
+ (<%= link_to "admin", request_admin_url(@info_request) %>)
+ <% end %>
+ <%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %>
</p>
<p id="request_status" class="request_icon_line icon_<%= @info_request.calculate_status %>">
<% if @info_request.awaiting_description %>
<% if @is_owning_user %>
- Please <strong>answer the question above</strong> so we know whether the
- <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
+ <%= _('Please <strong>answer the question above</strong> so we know whether the ')%>
+ <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> <%= _('useful information.') %>
<% else %>
- This request has an <strong>unknown status</strong>.
+ <%= _('This request has an <strong>unknown status</strong>.') %>
<% if @old_unclassified %>
- We're waiting for someone to read
+ <%= _('We\'re waiting for someone to read') %>
<%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
- and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?
+ <%= _('and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?') %>
<% else %>
- We're waiting for
- <%= user_link(@info_request.user) %> to read
+ <%= _('We\'re waiting for') %>
+ <%= user_link(@info_request.user) %> <%= _('to read') %>
<%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
- and update the status.
+ <%= _('and update the status.') %>
<% end %>
<% end %>
<% elsif @status == 'waiting_response' %>
- Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>,
- they must respond promptly and
+ <%= _('Currently <strong>waiting for a response</strong> from {{public_body_link}}, they must respond promptly and', :public_body_link=> public_body_link(@info_request.public_body)) %>
<% if @info_request.public_body.is_school? %>
- in term time
+ <%= _('in term time') %>
<% else %>
- normally
+ <%= _('normally') %>
<% end %>
- no later than <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
+ <%= _('no later than') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
(<%= link_to "details", "/help/requesting#quickly_response" %>).
<% elsif @status == 'waiting_response_overdue' %>
- Response to this request is <strong>delayed</strong>.
- By law, <%= public_body_link(@info_request.public_body) %> should
- normally have responded <strong>promptly</strong> and
+ <%= _('Response to this request is <strong>delayed</strong>.') %>
+ <%= _('By law, {{public_body_link}} should normally have responded <strong>promptly</strong> and',:public_body_link=>public_body_link(@info_request.public_body)) %>
<% if @info_request.public_body.is_school? %>
- in term time
+ <%= _('in term time') %>
<% end %>
- by <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
- (<%= link_to "details", "/help/requesting#quickly_response" %>).
+ <%= _('by') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
+ (<%= _('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response'] %>)
<% elsif @status == 'waiting_response_very_overdue' %>
- Response to this request is <strong>long overdue</strong>.
- By law, under all circumstances, <%= public_body_link(@info_request.public_body) %>
- should have responded by now
- (<%= link_to "details", "/help/requesting#quickly_response" %>).
- You can <strong>complain</strong> by
- <%= link_to "requesting an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
+ <%= _('Response to this request is <strong>long overdue</strong>.') %>
+ <%= _('By law, under all circumstances, {{public_body_link}} should have responded by now',:public_body_link => public_body_link(@info_request.public_body)) %>
+ (<%= _('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response'] %>).
+ <%= _('You can <strong>complain</strong> by') %>
+ <%= link_to _("requesting an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
<% elsif @status == 'not_held' %>
- <%= public_body_link(@info_request.public_body) %> <strong>did not have</strong> the information requested.
+ <%= public_body_link(@info_request.public_body) %> <%= _('<strong>did not have</strong> the information requested.') %>
<% elsif @status == 'rejected' %>
- The request was <strong>refused</strong> by <%= public_body_link(@info_request.public_body) %>.
+ <%= _('The request was <strong>refused</strong> by') %> <%= public_body_link(@info_request.public_body) %>.
<% elsif @status == 'successful' %>
- The request was <strong>successful</strong>.
+ <%= _('The request was <strong>successful</strong>.') %>
+ <% elsif @status == 'deadline_extended' %>
+ Currently <strong>deadline extended</strong> from <%= public_body_link(@info_request.public_body) %>,
+ they must respond promptly and normally no later than <strong><%= simple_date(@info_request.date_deadline_extended) %></strong>
+ (<%= link_to "details", "/help/requesting#deadline_extended" %>).
+ <% elsif @status == 'wrong_response' %>
+ <%= public_body_link(@info_request.public_body) %> has replied but the response <strong>does not correspond to the request</strong>.
<% elsif @status == 'partially_successful' %>
- The request was <strong>partially successful</strong>.
+ <%= _('The request was <strong>partially successful</strong>.') %>
<% elsif @status == 'waiting_clarification' %>
<% if @is_owning_user %>
- <%=h @info_request.public_body.name %> is <strong>waiting for your clarification</strong>.
- Please
- <%= link_to "send a follow up message", respond_to_last_url(@info_request) + '#followup' %>.
+ <%=h @info_request.public_body.name %> <%= _('is <strong>waiting for your clarification</strong>.') %>
+ <%= _('Please') %>
+ <%= link_to _("send a follow up message"), respond_to_last_url(@info_request) + '#followup' %>.
<% else %>
- The request is <strong>waiting for clarification</strong>.
- If you are
- <%= user_link(@info_request.user) %>, please
- <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
+ <%= _('The request is <strong>waiting for clarification</strong>.') %>
+ <%= _('If you are {{user_link}}, please',:user_link=>user_link(@info_request.user)) %>
+ <%= link_to _("sign in"), signin_url(:r => request.request_uri) %> <%= _('to send a follow up message.') %>
<% end %>
<% elsif @status == 'gone_postal' %>
- The authority would like to / has <strong>responded by post</strong> to this request.
+ <%= _('The authority would like to / has <strong>responded by post</strong> to this request.') %>
<% elsif @status == 'internal_review' %>
- Waiting for an <strong>internal review</strong> by <%= public_body_link(@info_request.public_body) %> of their handling of this request.
+ <%= _('Waiting for an <strong>internal review</strong> by {{public_body_link}} of their handling of this request.',:public_body_link=>public_body_link(@info_request.public_body)) %>
<% elsif @status == 'error_message' %>
- There was a <strong>delivery error</strong> or similar, which needs fixing by the WhatDoTheyKnow team.
+ <%= _('There was a <strong>delivery error</strong> or similar, which needs fixing by the WhatDoTheyKnow team.') %>
<% elsif @status == 'requires_admin' %>
- This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.
+ <%= _('This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.') %>
<% elsif @status == 'user_withdrawn' %>
- This request has been <strong>withdrawn</strong> by the person who made it.
- There may be an explanation in the correspondence below.
+ <%= _('This request has been <strong>withdrawn</strong> by the person who made it.
+ There may be an explanation in the correspondence below.') %>
<% else %>
<% raise "unknown status " + @status %>
<% end %>
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml
index 771081694..40c3b3d5b 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.rhtml
@@ -10,44 +10,44 @@
<% if @gone_postal %>
<div class="gone_postal_help">
- <h1>Which of these is happening?</h1>
+ <h1><%= _('Which of these is happening?') %></h1>
<dl>
<dt>
- The authority say that they <strong>need a postal
- address</strong>, not just an email, for it to be a valid FOI request
+ <%= _('The authority say that they <strong>need a postal
+ address</strong>, not just an email, for it to be a valid FOI request') %>
</dt>
<dd>
- The law, the Ministry of Justice and the Information Commissioner
- all say that an email is sufficient (<a href="/help/privacy#full_address">more details</a>).
- At the bottom of this page, write a reply to the authority explaining this to them.
+ <%= _('The law, the Ministry of Justice and the Information Commissioner
+ all say that an email is sufficient (<a href="%s">more details</a>).
+ At the bottom of this page, write a reply to the authority explaining this to them.') % [help_privacy_path + '#full_address'] %>
</dd>
<dt>
- The authority only has a <strong>paper copy</strong> of the information.
+ <%= _('The authority only has a <strong>paper copy</strong> of the information.') %>
</dt>
<dd>
- At the bottom of this page, write a reply to them trying to persuade them to scan it in
- (<a href="/help/privacy#postal_answer">more details</a>).
+ <%= _('At the bottom of this page, write a reply to them trying to persuade them to scan it in
+ (<a href="%s">more details</a>).') % [help_privacy_path + '#postal_answer'] %>
</dd>
<dt>
- You want to <strong>give your postal address</strong> to the authority in private.
+ <%= _('You want to <strong>give your postal address</strong> to the authority in private.') %>
</dt>
<dd>
- To do that please send a private email to <%=h(@postal_email_name)%>
+ <%= _('To do that please send a private email to ') %><%=h(@postal_email_name)%>
&lt;<%=link_to h(@postal_email), "mailto:" + @postal_email%>&gt;
- containing your postal address, and asking them to reply to this request.
- Or you could phone them.
+ <%= _('containing your postal address, and asking them to reply to this request.
+ Or you could phone them.') %>
- When you receive the paper response, please help
- others find out what it says:
+ <%= _('When you receive the paper response, please help
+ others find out what it says:') %>
<ul>
- <li>Add an annotation to your request with choice quotes, or
- a <strong>summary of the response</strong>.</li>
- <li>If you can, scan in or photograph the response, and <strong>send us
- a copy to upload</strong>.</li>
+ <li><%= _('Add an annotation to your request with choice quotes, or
+ a <strong>summary of the response</strong>.') %></li>
+ <li><%= _('If you can, scan in or photograph the response, and <strong>send us
+ a copy to upload</strong>.') %></li>
</ul>
</dd>
@@ -59,13 +59,13 @@
<% if !@incoming_message.nil? %>
<% if @is_owning_user %>
<% if @incoming_message.recently_arrived %>
- <h2>New response to your request '<%= request_link @info_request %>'</h2>
+ <h2><%= _('New response to your request') %> '<%= request_link @info_request %>'</h2>
<% else %>
- <h2>Response to your request '<%= request_link @info_request %>'</h2>
+ <h2><%= _('Response to your request') %> '<%= request_link @info_request %>'</h2>
<% end %>
<% else %>
<% if @incoming_message.recently_arrived %>
- <h2>New response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'</h2>
+ <h2><%= _('New response to {{law_used_short}} request',:law_used_short => h(@info_request.law_used_short))%> '<%= request_link @info_request %>'</h2>
<% else %>
<h2>Response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'</h2>
<% end %>
diff --git a/app/views/request/similar.rhtml b/app/views/request/similar.rhtml
index 33034d43b..d9806aeb1 100644
--- a/app/views/request/similar.rhtml
+++ b/app/views/request/similar.rhtml
@@ -4,7 +4,7 @@
<!-- Important terms: <%= @xapian_object.important_terms.join(" ") %> -->
<% if @xapian_object.results.empty? %>
- <p>No similar requests found.</p>
+ <p><%= _('No similar requests found.')%></p>
<% else %>
<!--
<p class="subtitle">
@@ -15,7 +15,7 @@
<% if result[:model].class.to_s == 'InfoRequestEvent' %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% else %>
- <p><strong>Unexpected search result type <%=result[:model].class.to_s%></strong></p>
+ <p><strong><%= _('Unexpected search result type ')%><%=result[:model].class.to_s%></strong></p>
<% end %>
<% end %>
<% end %>
diff --git a/app/views/request/upload_response.rhtml b/app/views/request/upload_response.rhtml
index 0f8329f8a..eaa6602a1 100644
--- a/app/views/request/upload_response.rhtml
+++ b/app/views/request/upload_response.rhtml
@@ -2,42 +2,42 @@
<%= foi_error_messages_for :comment %>
-<h1>Respond to the FOI request '<%=request_link(@info_request)%>' made by <%=user_link(@info_request.user) %></h1>
+<h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1>
<p>
- Your response will <strong>appear on the Internet</strong>, <a href="/help/officers">read why</a> and answers to other questions.
+ <%= _('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.')% [help_officers_path] %>
</p>
-<h2>Respond by email</h2>
+<h2><%= _('Respond by email')%></h2>
-<p>You should have received a copy of the request by email, and you can respond
-by <strong>simply replying</strong> to that email. For your convenience, here is the address:
+<p><%= _('You should have received a copy of the request by email, and you can respond
+by <strong>simply replying</strong> to that email. For your convenience, here is the address:')%>
<a href="mailto:<%=h @info_request.incoming_email%>"><%=h @info_request.incoming_email%></a>.
-You may <strong>include attachments</strong>. If you would like to attach a
-file too large for email, use the form below.
+<%= _('You may <strong>include attachments</strong>. If you would like to attach a
+file too large for email, use the form below.')%>
</p>
-<h2>Respond using the web</h2>
+<h2><%= _('Respond using the web')%></h2>
-<p>Enter your response below. You may attach one file (use email, or
-<a href="/help/contact">contact us</a> if you need more).</p>
+<p><%= _('Enter your response below. You may attach one file (use email, or
+<a href="%s">contact us</a> if you need more).')% [help_contact_path] %></p>
<% form_tag '', :html => { :id => 'upload_response_form' }, :multipart => true do %>
<p>
- <label class="form_label" for="body">Response:</label>
+ <label class="form_label" for="body"><% _('Response:')%></label>
<%= text_area_tag :body, "", :rows => 10, :cols => 55 %>
</p>
<p>
- <label class="form_label" for="file_1">Attachment (optional):</label>
+ <label class="form_label" for="file_1"><% _('Attachment (optional):')%></label>
<%= file_field_tag :file_1, :size => 35 %>
</p>
<p>
<%= hidden_field_tag 'submitted_upload_response', 1 %>
<%= submit_tag "Upload FOI response" %>
- (<strong>patience</strong>, especially for large files, it may take a while!)
+ <%= _(' (<strong>patience</strong>, especially for large files, it may take a while!)')%>
</p>
<% end %>
diff --git a/app/views/request_game/play.rhtml b/app/views/request_game/play.rhtml
index 36e9adac7..acf6cce87 100644
--- a/app/views/request_game/play.rhtml
+++ b/app/views/request_game/play.rhtml
@@ -1,11 +1,10 @@
-<% @title = 'Play the request categorisation game!' %>
+<% @title = _("Play the request categorisation game!") %>
<div id="game_sidebar">
<p style="text-align: center">
<img width=250 height=125 src="http://chart.apis.google.com/chart?chs=250x125&cht=gom&chd=t:<%=@percentage%>" alt="<%=@percentage%>% of requests have been categorised">
<br><%=pluralize(@missing, 'request')%> left to categorise / <%=@total %> total
</p>
-
<h2>Top recent players</h2>
<table>
<% c = 0; for user, count in @league_table_28_days %>
@@ -28,25 +27,20 @@
<% end %>
</table>
</div>
-
-<h2>Play the request categorisation game!</h2>
-
-<p>Some people who've made requests haven't let us know whether they were
+<h2><%= _("Play the request categorisation game!")%></h2>
+<p><%= _("Some people who've made requests haven't let us know whether they were
successful or not. We need <strong>your</strong> help &ndash;
choose one of these requests, read it, and let everyone know whether or not the
-information has been provided. Everyone'll be exceedingly grateful.</p>
-
+information has been provided. Everyone'll be exceedingly grateful.")%></p>
<% for info_request in @requests %>
<%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %>
<% end %>
-
<p id="game_buttons">
-<%= button_to "I don't like these ones &mdash; give me some more!", play_url %>
-<%= button_to "I don't want to do any more tidying now!", stop_url %>
+<%= button_to _('I don\'t like these ones &mdash; give me some more!'), play_url %>
+<%= button_to _('I don\'t want to do any more tidying now!'), stop_url %>
</p>
-
-<p>Thanks for helping - your work will make it easier for everyone to find successful
-responses, and maybe even let us make league tables...</p>
+<p><%= _('Thanks for helping - your work will make it easier for everyone to find successful
+responses, and maybe even let us make league tables...')%></p>
diff --git a/app/views/request_mailer/comment_on_alert.rhtml b/app/views/request_mailer/comment_on_alert.rhtml
index b1650318d..46cee3b1a 100644
--- a/app/views/request_mailer/comment_on_alert.rhtml
+++ b/app/views/request_mailer/comment_on_alert.rhtml
@@ -1,6 +1,6 @@
-<%=@comment.user.name%> has annotated your <%=@info_request.law_used_short%>
-request. Follow this link to see what they wrote.
+<%= _('{{user_name}} has annotated your {{law_used_short}}
+request. Follow this link to see what they wrote.',:user_name=>@comment.user.name,:law_used_short=>@info_request.law_used_short) %>
<%=@url%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/request_mailer/comment_on_alert_plural.rhtml b/app/views/request_mailer/comment_on_alert_plural.rhtml
index ee12ba975..3871a9598 100644
--- a/app/views/request_mailer/comment_on_alert_plural.rhtml
+++ b/app/views/request_mailer/comment_on_alert_plural.rhtml
@@ -1,6 +1,7 @@
-There are <%=@count%> new annotations on your <%=@info_request.law_used_short%>
-request. Follow this link to see what they wrote.
+<%= _('There are {{count}} new annotations on your {{info_request}} request. Follow this link to see what they wrote.',:count=>@count,:info_request=>@info_request.law_used_short)%>
<%=@url%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
+
+
diff --git a/app/views/request_mailer/new_response.rhtml b/app/views/request_mailer/new_response.rhtml
index c9d7e64fb..c3e979cd6 100644
--- a/app/views/request_mailer/new_response.rhtml
+++ b/app/views/request_mailer/new_response.rhtml
@@ -1,17 +1,17 @@
-You have a new response to the <%= @info_request.law_used_full %> request
-'<%= @info_request.title %>' that you made to
+<%= _('You have a new response to the {{law_used_full}} request ',:law_used_full=>@info_request.law_used_full)%>
+'<%= @info_request.title %>' <%=_('that you made to')%>
<%= @info_request.public_body.name %>.
-To view the response, click on the link below.
+<%= _('To view the response, click on the link below.')%>
<%=@url%>
-When you get there, please update the status to say if the response
-contains any useful information.
+<%= _('When you get there, please update the status to say if the response
+contains any useful information.' )%>
-Although all responses are automatically published, we depend on
-you, the original requester, to evaluate them.
+<%= _('Although all responses are automatically published, we depend on
+you, the original requester, to evaluate them.')%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/request_mailer/new_response_reminder_alert.rhtml b/app/views/request_mailer/new_response_reminder_alert.rhtml
index aa65c5196..cde7851db 100644
--- a/app/views/request_mailer/new_response_reminder_alert.rhtml
+++ b/app/views/request_mailer/new_response_reminder_alert.rhtml
@@ -1,11 +1,10 @@
-To let us know, follow this link and then select the appropriate box.
+<%=_('To let us know, follow this link and then select the appropriate box.')%>
<%=@url%>
-Your request was called '<%= @info_request.title %>'. Letting everyone know
-whether you got the information will help us keep tabs on
+<%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%>
<%= @info_request.public_body.name %>.
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/request_mailer/not_clarified_alert.rhtml b/app/views/request_mailer/not_clarified_alert.rhtml
index 40124d190..2e6cf6a05 100644
--- a/app/views/request_mailer/not_clarified_alert.rhtml
+++ b/app/views/request_mailer/not_clarified_alert.rhtml
@@ -1,10 +1,9 @@
-<%=@info_request.public_body.name%> has asked you to explain
-part of your <%=@info_request.law_used_short%> request.
-To do this, first click on the link below.
+<%=@info_request.public_body.name%> <%=('has asked you to explain part of your')%> <%=@info_request.law_used_short%> <%= _('request.')%>
+<%= _('To do this, first click on the link below.')%>
<%=@url%>
-You will only get an answer to your request if you follow up
-with the clarification.
+<%= _('You will only get an answer to your request if you follow up
+with the clarification.')%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/request_mailer/old_unclassified_updated.rhtml b/app/views/request_mailer/old_unclassified_updated.rhtml
index 715fcde3e..b03780016 100644
--- a/app/views/request_mailer/old_unclassified_updated.rhtml
+++ b/app/views/request_mailer/old_unclassified_updated.rhtml
@@ -1,12 +1,9 @@
-To help us keep the site tidy, someone else has updated the status of the
-<%= @info_request.law_used_full %> request '<%= @info_request.title %>'
-that you made to <%= @info_request.public_body.name %>, to
-"<%= @info_request.display_status.downcase %>" If you disagree with
-their categorisation, please update the status again yourself to what
-you believe to be more accurate.
+<%= _('To help us keep the site tidy, someone else has updated the status of the
+{{law_used_full}} request {{title}} that you made to {{public_body}}, to "{{display_status}}" If you disagree with their categorisation, please update the status again yourself to what you believe to be more accurate.',:law_used_full=>@info_request.law_used_full,:title=>@info_request.title, :public_body=>@info_request.public_body.name,:display_status=>@info_request.display_status.downcase)%>
-Follow this link to see the request:
+<%=_ ('Follow this link to see the request:')%>
<%= @url %>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
+
diff --git a/app/views/request_mailer/overdue_alert.rhtml b/app/views/request_mailer/overdue_alert.rhtml
index 29a1a1d68..65ae207a2 100644
--- a/app/views/request_mailer/overdue_alert.rhtml
+++ b/app/views/request_mailer/overdue_alert.rhtml
@@ -1,13 +1,11 @@
-<%= @info_request.public_body.name %> have delayed.
+<%= @info_request.public_body.name %> <%= _('have delayed.')%>
-They have not replied to your <%=@info_request.law_used_short%> request '<%= @info_request.title %>'
-promptly, as normally required by law<% if @info_request.public_body.is_school? %> during term time<% end %>.
+<%=_ ('They have not replied to your {{law_used_short}} request {{title}} promptly, as normally required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%=_ ('during term time')%> <% end %>.
-Click on the link below to send a message to <%= @info_request.public_body.name
-%> reminding them to reply to your request.
+<%= _('Click on the link below to send a message to {{public_body}} reminding them to reply to your request.',:public_body=>@info_request.public_body.name)%>
<%=@url%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/request_mailer/requires_admin.rhtml b/app/views/request_mailer/requires_admin.rhtml
index b0b2e926a..acd37f405 100644
--- a/app/views/request_mailer/requires_admin.rhtml
+++ b/app/views/request_mailer/requires_admin.rhtml
@@ -1,11 +1,11 @@
---------------------------------------------------------------------
-<%=@info_request.user.name%> has reported an <%=@info_request.law_used_short%>
-response as needing administrator attention. Take a look, and reply to this
-email to let them know what you are going to do about it.
+<%=@info_request.user.name%> <%= _('has reported an')%> <%=@info_request.law_used_short%>
+<%= _('response as needing administrator attention. Take a look, and reply to this
+email to let them know what you are going to do about it.')%>
Request '<%=@info_request.title%>':
<%= @url %>
-Administration URL:
+<%= _('Administration URL:') %>
<%= @admin_url %>
---------------------------------------------------------------------
diff --git a/app/views/request_mailer/stopped_responses.rhtml b/app/views/request_mailer/stopped_responses.rhtml
index 5c4fe704d..eb53cee1c 100644
--- a/app/views/request_mailer/stopped_responses.rhtml
+++ b/app/views/request_mailer/stopped_responses.rhtml
@@ -1,14 +1,20 @@
-The email that you, on behalf of <%= @info_request.public_body.name%>, sent to
-<%= @info_request.user.name %> to reply to an <%= @info_request.law_used_short %>
-request has not been delivered.
+<%= _('The email that you, on behalf of {{public_body}}, sent to
+{{user}} to reply to an {{law_used_short}}
+request has not been delivered.',:public_body=>@info_request.public_body.name,:user=>@info_request.user.name,:law_used_short=>@info_request.law_used_short)%>
+
+<%= _('This is because {{title}} is an old request that has been
+marked to no longer receive responses.',:title=>@info_request.title)%>
+
+
+
+<%= _('If this is incorrect, or you would like to send a late response to the request
+or an email on another subject to {{user}}, then please
+email {{contact_email}} for help.',:user=>@info_request.user.name,:contact_email=>@contact_email)%>
+
+<%= _('Your original message is attached.')%>
+
+-- <%= _('the WhatDoTheyKnow team') %>
-This is because '<%= @info_request.title %>' is an old request that has been
-marked to no longer receive responses.
-If this is incorrect, or you would like to send a late response to the request
-or an email on another subject to <%= @info_request.user.name %>, then please
-email <%=@contact_email%> for help.
-Your original message is attached.
--- the WhatDoTheyKnow team
diff --git a/app/views/request_mailer/very_overdue_alert.rhtml b/app/views/request_mailer/very_overdue_alert.rhtml
index 2393d29e5..e61b3a206 100644
--- a/app/views/request_mailer/very_overdue_alert.rhtml
+++ b/app/views/request_mailer/very_overdue_alert.rhtml
@@ -1,14 +1,11 @@
-<%= @info_request.public_body.name %> are long overdue.
+<%= @info_request.public_body.name %> <%= _('are long overdue.')%>
-They have not replied to your <%=@info_request.law_used_short%> request '<%= @info_request.title %>',
-as required by law<% if @info_request.public_body.is_school? %> even during holidays<% end %>.
+<%= _('They have not replied to your {{law_used_short}} request {{title}},
+as required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%= _('even during holidays')%><% end %>.
-Click on the link below to send a message to <%= @info_request.public_body.name
-%> telling them to reply to your request. You might like to ask for an internal
-review, asking them to find out why response to the request has been so slow.
+<%= _('Click on the link below to send a message to {{public_body_name}} telling them to reply to your request. You might like to ask for an internal
+review, asking them to find out why response to the request has been so slow.',:public_body_name=>@info_request.public_body.name)%>
<%=@url%>
--- the WhatDoTheyKnow team
-
-
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/track/_tracking_links.rhtml b/app/views/track/_tracking_links.rhtml
index c078d6db7..a08f97c08 100644
--- a/app/views/track/_tracking_links.rhtml
+++ b/app/views/track/_tracking_links.rhtml
@@ -6,7 +6,7 @@
<% if own_request %>
- <p>This is your own request, so you will be automatically emailed when new responses arrive.</p>
+ <p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
<% elsif existing_track %>
<% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form_" + location) do %>
<p>
diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml
index 45515e25f..df27a5cbd 100644
--- a/app/views/track_mailer/event_digest.rhtml
+++ b/app/views/track_mailer/event_digest.rhtml
@@ -1,4 +1,4 @@
-<%
+<%
# Construct the main text of the mail
main_text = ''
for track_thing, alert_results, xapian_object in @email_about_things
@@ -18,14 +18,14 @@
# e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008)
if event.event_type == 'response'
url = main_url(incoming_message_url(event.incoming_message))
- main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name
+ main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name
elsif event.event_type == 'followup_sent'
url = main_url(outgoing_message_url(event.outgoing_message))
- main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name
+ main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name
elsif event.event_type == 'sent'
# this is unlikely to happen in real life, but happens in the test code
url = main_url(outgoing_message_url(event.outgoing_message))
- main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name
+ main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name
elsif event.event_type == 'comment'
url = main_url(comment_url(event.comment))
main_text += event.comment.user.name + " added an annotation"
diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.rhtml
index 52c2a9e71..c6661696e 100644
--- a/app/views/user/_signin.rhtml
+++ b/app/views/user/_signin.rhtml
@@ -4,31 +4,31 @@
<%= foi_error_messages_for :user_signin %>
<% if not sign_in_as_existing_user %>
- <h2>If you've used WhatDoTheyKnow before</h2>
+ <h2><%= _('If you\'ve used WhatDoTheyKnow before')%></h2>
<% end %>
<p>
- <label class="form_label" for="user_signin_email">Your e-mail:</label>
+ <label class="form_label" for="user_signin_email"><%= _('Your e-mail:')%></label>
<%= text_field 'user_signin', 'email', { :size => 20 } %>
</p>
<p>
- <label class="form_label" for="user_signin_password">Password:</label>
+ <label class="form_label" for="user_signin_password"><%= _('Password:')%></label>
<%= password_field 'user_signin', 'password', { :size => 15 } %>
</p>
<p class="form_note">
- <%= link_to "Forgotten your password?", signchangepassword_url + "?pretoken=" + h(params[:token]) %>
+ <%= link_to _('Forgotten your password?'), signchangepassword_url + "?pretoken=" + h(params[:token]) %>
</p>
<p class="form_checkbox">
<%= check_box_tag 'remember_me', "1" %>
- <label for="remember_me">Remember me</label> (keeps you signed in longer;
- do not use on a public computer) </p>
+ <label for="remember_me"><%= _('Remember me</label> (keeps you signed in longer;
+ do not use on a public computer) ')%></p>
<div class="form_button">
<%= hidden_field_tag 'token', params[:token], { :id => 'signin_token' } %>
- <%= submit_tag "Sign in" %>
+ <%= submit_tag _('Sign in') %>
</div>
<% end %>
diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml
index 65b5ce6f2..70120bc5f 100644
--- a/app/views/user/_signup.rhtml
+++ b/app/views/user/_signup.rhtml
@@ -3,43 +3,42 @@
<% form_tag({:action => "signup"}, {:id => "signup_form"}) do %>
<%= foi_error_messages_for :user_signup %>
- <h2>If you're new to WhatDoTheyKnow</h2>
+ <h2><%= _('If you\'re new to WhatDoTheyKnow')%></h2>
<p>
- <label class="form_label" for="user_signup_email">Your e-mail:</label>
+ <label class="form_label" for="user_signup_email"><%= _('Your e-mail:')%></label>
<%= text_field 'user_signup', 'email', { :size => 20 } %>
</p>
<div class="form_item_note">
- We will not reveal your email address to anybody unless you or
- the law tell us to
- (<a href="/help/privacy">details</a>).
+ <%= ('We will not reveal your email address to anybody unless you or
+ the law tell us to (<a href="%s">_details</a>). ') %[help_privacy_path] %>
</div>
<p>
- <label class="form_label" for="user_signup_name">Your name:</label>
+ <label class="form_label" for="user_signup_name"> <%= _('Your name:')%></label>
<%= text_field 'user_signup', 'name', { :size => 20 } %>
</p>
<div class="form_item_note">
- Your <strong>name will appear publicly</strong>
- (<a href="/help/privacy#public_request">why?</a>)
+ <%= _('Your <strong>name will appear publicly</strong>
+ (<a href="%s">why?</a>)
on this website and in search engines. If you
are thinking of using a pseudonym, please
- <a href="/help/privacy#real_name">read this first</a>.
+ <a href="%s">read this first</a>.') % [help_privacy_path+"#public_request", help_privacy_path+"#real_name"] %>
</div>
<p>
- <label class="form_label" for="user_signup_password">Password:</label>
+ <label class="form_label" for="user_signup_password"> <%= _('Password:')%></label>
<%= password_field 'user_signup', 'password', { :size => 15 } %>
</p>
<p>
- <label class="form_label" for="user_signup_password_confirmation">Password: (again)</label>
+ <label class="form_label" for="user_signup_password_confirmation"> <%= _('Password: (again)')%></label>
<%= password_field 'user_signup', 'password_confirmation', { :size => 15 } %>
</p>
<div class="form_button">
<%= hidden_field_tag 'token', params[:token], { :id => 'signup_token' } %>
- <%= submit_tag "Sign up" %>
+ <%= submit_tag _('Sign up') %>
</div>
<% end %>
diff --git a/app/views/user/_user_listing_single.rhtml b/app/views/user/_user_listing_single.rhtml
index 9fa70c779..53df3a7e8 100644
--- a/app/views/user/_user_listing_single.rhtml
+++ b/app/views/user/_user_listing_single.rhtml
@@ -16,9 +16,9 @@ end %>
</span>
<span class="bottomline">
- <%= pluralize(display_user.info_requests.size, "request") %> made.
- <%= pluralize(display_user.visible_comments.size, "annotation") %> made.
- Joined in <%= year_from_date(display_user.created_at) %>.
+ <%= pluralize(display_user.info_requests.size, "request") %> <%= _('made.')%>
+ <%= pluralize(display_user.visible_comments.size, "annotation") %> <%= _('made.')%>
+ <%= _('Joined in')%> <%= year_from_date(display_user.created_at) %>.
</span>
</div>
diff --git a/app/views/user/bad_token.rhtml b/app/views/user/bad_token.rhtml
index 9855fb546..443835382 100644
--- a/app/views/user/bad_token.rhtml
+++ b/app/views/user/bad_token.rhtml
@@ -1,17 +1,17 @@
<h1>
-Please check the URL (i.e. the long code of letters and numbers) is copied
-correctly from your email.
+<%= _('Please check the URL (i.e. the long code of letters and numbers) is copied
+correctly from your email.'%>
</h1>
<p>
-If you can't click on it in the email, you'll have to <strong>select and copy
+<%= _('If you can\'t click on it in the email, you\'ll have to <strong>select and copy
it</strong> from the email. Then <strong>paste it into your browser</strong>, into the place
-you would type the address of any other webpage.
+you would type the address of any other webpage.')%>
</p>
<p>
-If you got the email <strong>more than six months ago</strong>, then this login link won't work any
-more. Please try doing what you were doing from the beginning.
+<%= _('If you got the email <strong>more than six months ago</strong>, then this login link won\'t work any
+more. Please try doing what you were doing from the beginning.')%>
</p>
diff --git a/app/views/user/banned.rhtml b/app/views/user/banned.rhtml
index 6bbdf4774..475c10977 100644
--- a/app/views/user/banned.rhtml
+++ b/app/views/user/banned.rhtml
@@ -6,14 +6,14 @@
<%=@details%>
</p>
-<p>You will be unable to make new requests, send follow ups, add annotations or
+<p><%= _('You will be unable to make new requests, send follow ups, add annotations or
send messages to other users. You may continue to view other requests, and set
up
-email alerts.</p>
+email alerts.')%></p>
<p>
-If you would like us to lift this ban, then you may politely
+<%= _('If you would like us to lift this ban, then you may politely
<a href="/help/contact">contact us</a> giving reasons.
-</p>
+')%></p>
diff --git a/app/views/user/confirm.rhtml b/app/views/user/confirm.rhtml
index bc9b259cc..bdaf5c8e9 100644
--- a/app/views/user/confirm.rhtml
+++ b/app/views/user/confirm.rhtml
@@ -3,12 +3,12 @@
<h1 class="confirmation_heading">Now check your email!</h1>
<p class="confirmation_message">
-We've sent you an email, and you'll need to click the link in it before you can
-continue.
+<%= _('We\'ve sent you an email, and you\'ll need to click the link in it before you can
+continue.') %>
</p>
<p class="confirmation_message">
-<small>If you use web-based email or have "junk mail" filters, also check your
+<%= _('<small>If you use web-based email or have "junk mail" filters, also check your
bulk/spam mail folders. Sometimes, our messages are marked that way.</small>
-</p>
+</p>') %>
diff --git a/app/views/user/contact.rhtml b/app/views/user/contact.rhtml
index 7069b671a..4bbb15789 100644
--- a/app/views/user/contact.rhtml
+++ b/app/views/user/contact.rhtml
@@ -29,11 +29,11 @@
<p class="form_note">
<% if @user == @recipient_user %>
- <strong>Note:</strong> You're sending a message to yourself, presumably
- to try out how it works.
+ <%= _('<strong>Note:</strong> You\'re sending a message to yourself, presumably
+ to try out how it works.')%>
<% else %>
- <strong>Privacy note:</strong> Your email address will be given to
- <%= user_link(@recipient_user) %> when you send this message.
+ <%= _(' <strong>Privacy note:</strong> Your email address will be given to')%>
+ <%= user_link(@recipient_user) %><%= _(' when you send this message.')%>
<% end %>
</p>
diff --git a/app/views/user/no_cookies.rhtml b/app/views/user/no_cookies.rhtml
index 4681547d3..b5c36b57e 100644
--- a/app/views/user/no_cookies.rhtml
+++ b/app/views/user/no_cookies.rhtml
@@ -1,19 +1,22 @@
<% @title = "Cookies not enabled" %>
-<h1>Please enable "cookies" to carry on</h1>
+<h1><%= _('Please enable "cookies" to carry on')%></h1>
-<p>To carry on, you need to sign in or make an account. Unfortunately, there
-was a technical problem trying to do this.</p>
+<p><%= _('To carry on, you need to sign in or make an account. Unfortunately, there
+was a technical problem trying to do this.')%></p>
-<p>It may be that your browser is not set to accept a thing called "cookies",
+<p><%= _('It may be that your browser is not set to accept a thing called "cookies",
or cannot do so. If you can, please enable cookies, or try using a different
-browser. Then press refresh to have another go.</p>
+browser. Then press refresh to have another go.')%></p>
-<p>If your browser is set to accept cookies and you are seeing this message,
-then there is probably a fault with our server. Please <a href="/help/contact">get in touch</a>
-with us so we can fix it. Let us know what you were doing when this message
-appeared and your browser and operating system type and version.</p>
+<p><%= _('If your browser is set to accept cookies and you are seeing this message,
+then there is probably a fault with our server.')%>
-<p>If you are still having trouble, please <a href="/help/contact">contact us</a>.
+<%= _('Please <a href="%s">get in touch</a> with us so we can fix it.') % [help_contact_path] %>
+
+ <%= _('Let us know what you were doing when this message
+appeared and your browser and operating system type and version.')%></p>
+
+<p><%= _('If you are still having trouble, please <a href="%s">contact us</a>.') % [help_contact_path] %>
</p>
diff --git a/app/views/user/set_crop_profile_photo.rhtml b/app/views/user/set_crop_profile_photo.rhtml
index 12ba4eba2..33b78e193 100644
--- a/app/views/user/set_crop_profile_photo.rhtml
+++ b/app/views/user/set_crop_profile_photo.rhtml
@@ -1,9 +1,9 @@
-<% @title = "Change profile photo" %>
+<% @title = _("Change profile photo") %>
<% @profile_photo_javascript = true %>
<% raise "internal error" if not @user %>
-<h2>Crop your profile photo</h2>
+<h2><%= _('Crop your profile photo') %></h2>
<%= foi_error_messages_for :set_profile_photo %>
@@ -32,8 +32,8 @@
<%= hidden_field_tag 'draft_profile_photo_id', @draft_profile_photo.id %>
- <p><strong>Privacy note:</strong> Your photo will be shown in public on the Internet,
- wherever you do something on WhatDoTheyKnow.
+ <p><%= _('<strong>Privacy note:</strong> Your photo will be shown in public on the Internet,
+ wherever you do something on WhatDoTheyKnow.')%>
<p>
<%= hidden_field_tag 'submitted_crop_profile_photo', 1 %>
diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml
index a3d28cf92..b6a39df5e 100644
--- a/app/views/user/set_draft_profile_photo.rhtml
+++ b/app/views/user/set_draft_profile_photo.rhtml
@@ -10,17 +10,17 @@
<% form_tag 'set_photo', :id => 'set_draft_profile_photo_form', :multipart => true do %>
<p>
- <label class="form_label" for="file_1">Photo of you:</label>
+ <label class="form_label" for="file_1"><%= _('Photo of you:')%></label>
<%= file_field_tag :file, :size => 35, :id => 'file_1' %>
</p>
<ul>
- <li>Your photo will be shown in public <strong>on the Internet</strong>,
- wherever you do something on WhatDoTheyKnow.
+ <li><%= _('Your photo will be shown in public <strong>on the Internet</strong>,
+ wherever you do something on WhatDoTheyKnow.')%>
</li>
- <li>Please don't upload offensive pictures. We will take down images
- that we consider inappropriate.
+ <li><%= _('Please don\'t upload offensive pictures. We will take down images
+ that we consider inappropriate.')%>
</li>
</ul>
@@ -29,7 +29,7 @@
<%= hidden_field_tag 'submitted_draft_profile_photo', 1 %>
<script type="text/javascript" charset="utf-8">
- document.write('<%= submit_tag "Next, crop your photo &gt;&gt;" %>');
+ document.write('<%= submit_tag _("Next, crop your photo &gt;&gt;") %>');
</script>
</p>
@@ -43,7 +43,7 @@
<% if @user.profile_photo %>
- <h2>OR remove the existing photo</h2>
+ <h2><%= _('OR remove the existing photo')%></h2>
<% form_tag 'clear_photo', :id => 'clear_profile_photo_form', :multipart => true do %>
<%= submit_tag "Clear photo" %>
diff --git a/app/views/user/set_profile_about_me.rhtml b/app/views/user/set_profile_about_me.rhtml
index 8e83dc870..aa53d6720 100644
--- a/app/views/user/set_profile_about_me.rhtml
+++ b/app/views/user/set_profile_about_me.rhtml
@@ -1,37 +1,37 @@
-<% @title = "Change the text about you on your profile at WhatDoTheyKnow.com" %>
+<% @title = _('Change the text about you on your profile at WhatDoTheyKnow.com') %>
-<% raise "internal error" if not @user %>
+<% raise _('internal error') if not @user %>
<%= foi_error_messages_for :about_me %>
<% form_for :about_me do |f| %>
<div class="form_note">
- <h1>Edit text about you</h1>
+ <h1><%= _('Edit text about you')%></h1>
<p>
- What are you investigating using Freedom of Information?
+ <%= _(' What are you investigating using Freedom of Information? ')%>
</p>
<p>
- This will appear on your WhatDoTheyKnow profile, to make it
- easier for others to get involved with what you're doing.
+ <%= _(' This will appear on your WhatDoTheyKnow profile, to make it
+ easier for others to get involved with what you\'re doing.')%>
</p>
</div>
<p>
- <label class="form_label" for="set_profile_about_me">About you:</label>
+ <label class="form_label" for="set_profile_about_me"><%= _('About you:')%></label>
<%= f.text_area :about_me, :rows => 5, :cols => 55 %>
</p>
<div class="form_note">
<p>
- Include relevant links, such as to a campaign page, your blog or a
+ <%= _(' Include relevant links, such as to a campaign page, your blog or a
twitter account. They will be made clickable.
- e.g.
+ e.g.')%>
<a href="http://www.twitter.com/whatdotheyknow">http://www.twitter.com/whatdotheyknow</a>
</p>
</div>
<div class="form_button">
<%= hidden_field_tag 'submitted_about_me', 1 %>
- <%= submit_tag "Save" %>
+ <%= submit_tag _('Save') %>
</div>
<% end %>
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 8bd758f78..09bf3de5f 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -1,39 +1,39 @@
<% @title = h(@display_user.name) + " - Freedom of Information requests" %>
<% if (@same_name_users.size >= 1) %>
- <p>There is <strong>more than one person</strong> who uses this site and has this name.
- One of them is shown below, you may mean a different one: <% for @same_name_user in @same_name_users %>
+ <p><%= _('There is <strong>more than one person</strong> who uses this site and has this name.
+ One of them is shown below, you may mean a different one:')%> <% for @same_name_user in @same_name_users %>
<%= user_link(@same_name_user) %>
<% end %>
<% end%>
<% if @is_you && @undescribed_requests.size > 0 %>
<div class="undescribed_requests">
- <p>Please <strong>go to the following requests</strong>, and let us
- know if there was information in the recent responses to them.</p>
+ <p><%= _('Please <strong>go to the following requests</strong>, and let us
+ know if there was information in the recent responses to them.')%></p>
<ul>
<% for undescribed_request in @undescribed_requests %>
<li><%=request_link(undescribed_request)%></li>
<% end %>
</ul>
<p>
- Thanks very much - this will help others find useful stuff. We'll
+ <%= _('Thanks very much - this will help others find useful stuff. We\'ll
also, if you need it, give advice on what to do next about your
- requests.
+ requests.')%>
</p>
</div>
<% end %>
<div id="request_sidebar">
- <h2>Track this person</h2>
+ <h2><%= _('Track this person')%></h2>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
- <h2>On this page</h2>
- <a href="#foi_requests">FOI requests</a>
- <br><a href="#annotations">Annotations</a>
+ <h2><%= _('On this page')%></h2>
+ <a href="#foi_requests"><%= _('FOI requests')%></a>
+ <br><a href="#annotations"><%= _('Annotations')%></a>
<% if @is_you %>
- <br><a href="#email_subscriptions">Email subscriptions</a>
+ <br><a href="#email_subscriptions"><%= _('Email subscriptions')%></a>
<% end %>
</div>
@@ -50,25 +50,25 @@
<% else %>
<% if @is_you %>
<span id="set_photo">
- <%= link_to "Set your profile photo", set_profile_photo_url() %>
+ <%= link_to _('Set your profile photo'), set_profile_photo_url() %>
</span>
<% end %>
<% end %>
</p>
- <h1> <%= h(@display_user.name) + (@is_you ? " (you)" : "") %> </h1>
+ <h1> <%= h(@display_user.name) + (@is_you ? _(" (you)") : "") %></h1>
<p class="subtitle">
- Joined WhatDoTheyKnow in <%= year_from_date(@display_user.created_at) %>
+ <%= _('Joined WhatDoTheyKnow in') %> <%= year_from_date(@display_user.created_at) %>
<% if !@user.nil? && @user.admin_page_links? %>
(<%= link_to "admin", user_admin_url(@display_user) %>)
<% end %>
</p>
<p>
- <%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
+ <%= link_to _('Send message to ') + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
<% if @is_you %>
- (just to see how it works)
+ (<%= _('just to see how it works')%>)
<% end %>
</p>
@@ -76,11 +76,11 @@
<div id="user_public_banned">
<p>
<strong>
- This user has been banned from WhatDoTheyKnow.com
+ <%= _('This user has been banned from WhatDoTheyKnow.com ')%>
</strong>
</p>
<p>
- They have been given the following explanation:
+ <%= _('They have been given the following explanation:')%>
</p>
<p class="details">
<%= @display_user.can_fail_html %>
@@ -93,7 +93,7 @@
<img class="comment_quote" src="/images/quote.png" alt="">
<%= @display_user.get_about_me_for_html_display %>
<% if @is_you %>
- (<%= link_to "edit text about you", set_profile_about_me_url() %>)
+ (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
<% end %>
</div>
<% end %>
@@ -101,31 +101,31 @@
<% if @is_you %>
<p id="user_change_password_email">
<% if @display_user.profile_photo %>
- <%= link_to "Change profile photo", set_profile_photo_url() %> |
+ <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
<% end %>
- <%= link_to "Change your password", signchangepassword_url() %> |
- <%= link_to "Change your email", signchangeemail_url() %>
+ <%= link_to _('Change your password'), signchangepassword_url() %> |
+ <%= link_to _('Change your email'), signchangeemail_url() %>
</p>
<% end %>
<% if not @is_you %>
<p id="user_not_logged_in">
- <%= link_to "Sign in", signin_url(:r => request.request_uri) %> to change password,
- subscriptions and more (<%=h @display_user.name %> only)
+ <%= link_to _('Sign in'), signin_url(:r => request.request_uri) %><%= _('to change password,
+ subscriptions and more')%> (<%=h @display_user.name %> <%= _('only')%>)
</p>
<% end %>
<% if !@xapian_requests.nil? %>
<% if @xapian_requests.results.empty? %>
<% if @page == 1 %>
- <h2 id="foi_requests">Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %> </h2>
- <p><%= @is_you ? 'You have' : 'This person has' %>
- made no Freedom of Information requests using this site.</p>
+ <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? 'you' : 'this person' %> </h2>
+ <p><%= @is_you ? _('You have') : _('This person has') %>
+ <%= _(' made no Freedom of Information requests using this site.')%></p>
<% end %>
<% else %>
<h2 id="foi_requests">
<%= @is_you ? 'Your ' : "This person's " %>
- <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %>
+ <%=pluralize(@display_user.info_requests.size, _('Freedom of Information request')) %>
<!-- matches_estimated <%=@xapian_requests.matches_estimated%> -->
<%= @page_desc %>
</h2>
@@ -137,20 +137,20 @@
<%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %>
<% end %>
<% else %>
- <h2 id="foi_requests">Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %> </h2>
- <p>The search index is currently offline, so we can't show the Freedom of Information requests this person has made.</p>
+ <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? _('you') : _('this person') %> </h2>
+ <p><%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%></p>
<% end %>
<% if !@xapian_comments.nil? %>
<% if @xapian_comments.results.empty? %>
<% if @page == 1 %>
- <h2><%= @is_you ? 'Your' : 'This person\'s' %> annotations </h2>
+ <h2><%= @is_you ? 'Your' : 'This person\'s' %> <%= _('annotations')%> </h2>
<p>None made.</p>
<% end %>
<% else %>
<h2 id="annotations">
- <%= @is_you ? 'Your ' : "This person's " %>
- <%=pluralize(@display_user.visible_comments.size, "annotation") %>
+ <%= @is_you ? _('Your ') : _('This person\'s') %>
+ <%=pluralize(@display_user.visible_comments.size, _('annotation')) %>
<!-- matches_estimated <%=@xapian_comments.matches_estimated%> -->
<%= @page_desc %>
</h2>
@@ -165,10 +165,10 @@
<% if @is_you %>
<% if @track_things.empty? %>
- <h2 id="email_subscriptions"> Your email subscriptions</h2>
+ <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2>
<p>None made.</p>
<% else %>
- <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, "email subscription") %> </h2>
+ <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2>
<% if @track_things_grouped.size == 1 %>
<% form_tag :controller => 'track', :action => 'delete_all_type' do %>
<h3>
@@ -177,7 +177,7 @@
<%= hidden_field_tag 'user', @display_user.id %>
<%= hidden_field_tag 'r', request.request_uri %>
<% if @track_things.size > 1 %>
- <%= submit_tag "unsubscribe all" %>
+ <%= submit_tag _('unsubscribe all') %>
<% end %>
</h3>
<% end %>
@@ -191,7 +191,7 @@
<%= hidden_field_tag 'user', @display_user.id %>
<%= hidden_field_tag 'r', request.request_uri %>
<% if track_things.size > 1 %>
- <%= submit_tag "unsubscribe all" %>
+ <%= submit_tag _('unsubscribe all')%>
<% end %>
</h3>
<% end %>
@@ -205,7 +205,7 @@
<%= track_thing.params[:list_description] %>
<%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %>
<%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s } %>
- <%= submit_tag "unsubscribe" %>
+ <%= submit_tag _('unsubscribe') %>
</div>
<% end %>
</li>
diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml
index 81dc64cd2..b76edbc64 100644
--- a/app/views/user/sign.rhtml
+++ b/app/views/user/sign.rhtml
@@ -5,10 +5,10 @@
<p id="sign_in_reason">
<% if @post_redirect.reason_params[:web].empty? %>
- Please sign in as <%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
+ <%= _('Please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
<% else %>
<%= @post_redirect.reason_params[:web] %>,
- please sign in as <%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
+ <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
<% end %>
</p>
@@ -17,15 +17,15 @@
</div>
<% else %>
- <% @title = "Sign in or make a new account" %>
+ <% @title = _('Sign in or make a new account') %>
<div id="sign_together">
<p id="sign_in_reason">
<% if @post_redirect.reason_params[:web].empty? %>
- Please sign in or make a new account.
+ <%= _(' Please sign in or make a new account.') %>
<% else %>
- <%= @post_redirect.reason_params[:web] %>, please sign in or make a new account.
+ <%= @post_redirect.reason_params[:web] %>, <%= _('please sign in or make a new account.') %>
<% end %>
</p>
diff --git a/app/views/user/signchangeemail.rhtml b/app/views/user/signchangeemail.rhtml
index b98dc383c..c0c559380 100644
--- a/app/views/user/signchangeemail.rhtml
+++ b/app/views/user/signchangeemail.rhtml
@@ -1,6 +1,6 @@
-<% @title = "Change your email address used on WhatDoTheyKnow.com" %>
+<% @title = _('Change your email address used on {{site_name}}', :site_name => site_name) %>
-<% raise "internal error" if not @user %>
+<% raise _('internal error') if not @user %>
<div id="change_email">
@@ -8,28 +8,28 @@
<%= foi_error_messages_for :signchangeemail %>
<div class="form_note">
- <h1>Change your email address used on WhatDoTheyKnow.com</h1>
+ <h1> <% _('Change your email address used on {{site_name}}', :site_name => site_name) %></h1>
</div>
<p>
- <label class="form_label" for="signchangeemail_old_email">Old e-mail:</label>
+ <label class="form_label" for="signchangeemail_old_email"> <%= _('Old e-mail:')%></label>
<%= text_field 'signchangeemail', 'old_email', { :size => 20 } %>
</p>
<p>
- <label class="form_label" for="signchangeemail_new_email">New e-mail:</label>
+ <label class="form_label" for="signchangeemail_new_email"> <%= _('New e-mail:')%></label>
<%= text_field 'signchangeemail', 'new_email', { :size => 20 } %>
</p>
<p>
- <label class="form_label" for="signchangeemail_password">Your password:</label>
+ <label class="form_label" for="signchangeemail_password"> <%= _('Your password:')%></label>
<%= password_field 'signchangeemail', 'password', { :size => 15 } %>
</p>
<p class="form_note">
- <strong>Note:</strong>
+ <%= _('<strong>Note:</strong>
We will send an email to your new email address. Follow the
- instructions in it to confirm changing your email.
+ instructions in it to confirm changing your email.')%>
</p>
<div class="form_button">
diff --git a/app/views/user/signchangeemail_confirm.rhtml b/app/views/user/signchangeemail_confirm.rhtml
index 96acbf424..bfedbac2d 100644
--- a/app/views/user/signchangeemail_confirm.rhtml
+++ b/app/views/user/signchangeemail_confirm.rhtml
@@ -1,14 +1,14 @@
<% @title = h("Now check your email!") %>
-<h1 class="confirmation_heading">Now check your email!</h1>
+<h1 class="confirmation_heading"> <%= _('Now check your email!')%></h1>
<p class="confirmation_message">
-We've sent an email to your new email address. You'll need to click the link in
-it before your email address will be changed.
+ <%= _('We\'ve sent an email to your new email address. You\'ll need to click the link in
+it before your email address will be changed.')%>
</p>
<p class="confirmation_message">
-<small>If you use web-based email or have "junk mail" filters, also check your
-bulk/spam mail folders. Sometimes, our messages are marked that way.</small>
+<small> <%= _('If you use web-based email or have "junk mail" filters, also check your
+bulk/spam mail folders. Sometimes, our messages are marked that way.')%></small>
</p>
diff --git a/app/views/user/signchangepassword.rhtml b/app/views/user/signchangepassword.rhtml
index 4191344cb..edb980b9f 100644
--- a/app/views/user/signchangepassword.rhtml
+++ b/app/views/user/signchangepassword.rhtml
@@ -1,4 +1,4 @@
-<% @title = "Change your password on WhatDoTheyKnow.com" %>
+<% @title = _('Change your password on {{site_name}}', :site_name => site_name) %>
<% raise "internal error" if not @user %>
@@ -8,23 +8,23 @@
<%= foi_error_messages_for :user %>
<div class="form_note">
- <h1>Change your password on WhatDoTheyKnow.com</h1>
+ <h1><%= _('Change your password on {{site_name}}', :site_name => site_name)%></h1>
</div>
<p>
- <label class="form_label" for="user_password">New password:</label>
+ <label class="form_label" for="user_password"><%= _('New password:')%></label>
<%= password_field 'user', 'password', { :size => 15 } %>
</p>
<p>
- <label class="form_label" for="user_password_confirmation">New password: (again)</label>
+ <label class="form_label" for="user_password_confirmation"><%= _('New password: (again)')%></label>
<%= password_field 'user', 'password_confirmation', { :size => 15 } %>
</p>
<div class="form_button">
<%= hidden_field_tag 'submitted_signchangepassword_do', 1 %>
<%= hidden_field_tag 'pretoken', params[:pretoken] %>
- <%= submit_tag "Change password on WhatDoTheyKnow.com" %>
+ <%= submit_tag _('Change password on {{site_name}}', :site_name => site_name) %>
</div>
<% end %>
diff --git a/app/views/user/signchangepassword_confirm.rhtml b/app/views/user/signchangepassword_confirm.rhtml
index baad6729b..63b6515cd 100644
--- a/app/views/user/signchangepassword_confirm.rhtml
+++ b/app/views/user/signchangepassword_confirm.rhtml
@@ -1,13 +1,13 @@
-<% @title = h("Now check your email!") %>
+<% @title = h( _('Now check your email!')) %>
-<h1 class="confirmation_heading">Now check your email!</h1>
+<h1 class="confirmation_heading"><%= _('Now check your email!')%></h1>
<p class="confirmation_message">
-We've sent you an email, click the link in it, then you can change your password.
+<%= _('We\'ve sent you an email, click the link in it, then you can change your password.')%>
</p>
<p class="confirmation_message">
-<small>If you use web-based email or have "junk mail" filters, also check your
-bulk/spam mail folders. Sometimes, our messages are marked that way.</small>
+<small><%= _('If you use web-based email or have "junk mail" filters, also check your
+bulk/spam mail folders. Sometimes, our messages are marked that way.')%></small>
</p>
diff --git a/app/views/user/signchangepassword_send_confirm.rhtml b/app/views/user/signchangepassword_send_confirm.rhtml
index 8b2e4fa91..84ee28f07 100644
--- a/app/views/user/signchangepassword_send_confirm.rhtml
+++ b/app/views/user/signchangepassword_send_confirm.rhtml
@@ -1,4 +1,4 @@
-<% @title = "Change your password on WhatDoTheyKnow.com" %>
+<% @title = _('Change your password on {{site_name}}', :site_name => site_name) %>
<div id="change_password">
@@ -6,24 +6,24 @@
<%= foi_error_messages_for :signchangepassword %>
<div class="form_note">
- <h1>Change your password on WhatDoTheyKnow.com</h1>
+ <h1><%= _('Change your password on {{site_name}}', :site_name => site_name) %></h1>
</div>
<p>
- <label class="form_label" for="signchangepassword_email">Your e-mail:</label>
+ <label class="form_label" for="signchangepassword_email"><%= _('Your e-mail:')%></label>
<%= text_field 'signchangepassword', 'email', { :size => 20 } %>
</p>
<p class="form_note">
- <strong>Note:</strong>
+ <%= _(' <strong>Note:</strong>
We will send you an email. Follow the instructions in it to change
- your password.
+ your password.')%>
</p>
<div class="form_button">
<%= hidden_field_tag 'submitted_signchangepassword_send_confirm', 1 %>
<%= hidden_field_tag 'pretoken', params[:pretoken] %>
- <%= submit_tag "Submit" %>
+ <%= submit_tag _('Submit') %>
</div>
<% end %>
diff --git a/app/views/user/wrong_user.rhtml b/app/views/user/wrong_user.rhtml
index cb8eb8eac..9878d08ae 100644
--- a/app/views/user/wrong_user.rhtml
+++ b/app/views/user/wrong_user.rhtml
@@ -1,8 +1,8 @@
<p id="sign_in_reason">
<%= @reason_params[:web] %>, please
-<%= link_to "sign out", signout_url(:r => request.request_uri) %>,
-and sign in as <%= h(@reason_params[:user_name]) %>.
+<%= link_to _('sign out'), signout_url(:r => request.request_uri) %>,
+<%= _('and sign in as ')%><%= h(@reason_params[:user_name]) %>.
</p>
diff --git a/app/views/user/wrong_user_unknown_email.rhtml b/app/views/user/wrong_user_unknown_email.rhtml
index 77a6837f5..77a2ca001 100644
--- a/app/views/user/wrong_user_unknown_email.rhtml
+++ b/app/views/user/wrong_user_unknown_email.rhtml
@@ -1,8 +1,8 @@
<p id="sign_in_reason">
-<%= @reason_params[:web] %>. Unfortunately we don't know the FOI
-email address for that authority, so we can't validate this.
-Please <a href="/help/contact">contact us</a> to sort it out.
+<%= @reason_params[:web] %>. <%= _('Unfortunately we don\'t know the FOI
+email address for that authority, so we can\'t validate this.
+Please <a href="%s">contact us</a> to sort it out.') % [help_contact_path] %>
</p>
diff --git a/app/views/user_mailer/already_registered.rhtml b/app/views/user_mailer/already_registered.rhtml
index 165df469c..3bdb3d04b 100644
--- a/app/views/user_mailer/already_registered.rhtml
+++ b/app/views/user_mailer/already_registered.rhtml
@@ -1,11 +1,11 @@
<%= @name %>,
-You just tried to sign up to WhatDoTheyKnow.com, when you
+<%= _('You just tried to sign up to WhatDoTheyKnow.com, when you
already have an account. Your name and password have been
left as they previously were.
-Please click on the link below. <%=@reasons[:email]%>
+Please click on the link below.')%> <%=@reasons[:email]%>
<%=@url%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/user_mailer/changeemail_already_used.rhtml b/app/views/user_mailer/changeemail_already_used.rhtml
index 0f60ad798..011c6ee81 100644
--- a/app/views/user_mailer/changeemail_already_used.rhtml
+++ b/app/views/user_mailer/changeemail_already_used.rhtml
@@ -1,9 +1,9 @@
-Someone, perhaps you, just tried to change their email address on
-WhatDoTheyKnow.com from <%=@old_email%> to <%=@new_email%>.
+<%= _('Someone, perhaps you, just tried to change their email address on
+WhatDoTheyKnow.com from ')%><%=@old_email%> <%= _('to')%> <%=@new_email%>.
-This was not possible because there is already an account using
-the email address <%=@new_email%>.
+<%= _('This was not possible because there is already an account using
+the email address ')%><%=@new_email%>.
-The accounts have been left as they previously were.
+<%= _('The accounts have been left as they previously were.')%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/user_mailer/changeemail_confirm.rhtml b/app/views/user_mailer/changeemail_confirm.rhtml
index 9aa288fb0..b7eff308d 100644
--- a/app/views/user_mailer/changeemail_confirm.rhtml
+++ b/app/views/user_mailer/changeemail_confirm.rhtml
@@ -1,12 +1,12 @@
<%= @name %>,
-Please click on the link below to confirm that you want to
+<%= _('Please click on the link below to confirm that you want to
change the email address that you use for WhatDoTheyKnow
-from <%=@old_email%> to <%=@new_email%>
+from ')%><%=@old_email%> <%= _('to ')%><%=@new_email%>
<%=@url%>
-We will not reveal your email addresses to anybody unless you
-or the law tell us to.
+<%= _('We will not reveal your email addresses to anybody unless you
+or the law tell us to.')%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>
diff --git a/app/views/user_mailer/confirm_login.rhtml b/app/views/user_mailer/confirm_login.rhtml
index 07d182676..b68e9abb1 100644
--- a/app/views/user_mailer/confirm_login.rhtml
+++ b/app/views/user_mailer/confirm_login.rhtml
@@ -1,11 +1,11 @@
<%= @name %>,
-Please click on the link below to confirm your email address.
+<%= _('Please click on the link below to confirm your email address.')%>
<%=@reasons[:email]%>
<%=@url%>
-We will not reveal your email address to anybody unless you
-or the law tell us to.
+<%= _('We will not reveal your email address to anybody unless you
+or the law tell us to.')%>
--- the WhatDoTheyKnow team
+-- <%= _('the WhatDoTheyKnow team') %>