From 5d22285eef67627c58320f031d03d2bffd0ba55e Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 17 Jan 2013 05:26:54 +1100 Subject: Set locale with I18n rather than through globalize Conflicts: app/controllers/general_controller.rb --- app/controllers/request_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index ec5c9d055..8807d2354 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -52,7 +52,7 @@ class RequestController < ApplicationController medium_cache end @locale = self.locale_from_params() - PublicBody.with_locale(@locale) do + I18n.with_locale(@locale) do # Look up by old style numeric identifiers if params[:url_title].match(/^[0-9]+$/) @@ -811,7 +811,7 @@ class RequestController < ApplicationController # FOI officers can upload a response def upload_response @locale = self.locale_from_params() - PublicBody.with_locale(@locale) do + I18n.with_locale(@locale) do @info_request = InfoRequest.find_by_url_title!(params[:url_title]) @reason_params = { @@ -868,7 +868,7 @@ class RequestController < ApplicationController def download_entire_request @locale = self.locale_from_params() - PublicBody.with_locale(@locale) do + I18n.with_locale(@locale) do @info_request = InfoRequest.find_by_url_title!(params[:url_title]) # Test for whole request being hidden or requester-only if !@info_request.all_can_view? -- cgit v1.2.3 From 884b879400f7da1e70436a42469cbfdda6e2d6c2 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 21 Jan 2013 17:24:55 +0000 Subject: Use {{}} instead of %s in url interpolation. --- app/controllers/request_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 49d2f35f3..cbd6543cb 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -322,9 +322,9 @@ class RequestController < ApplicationController message = "" if @outgoing_message.contains_email? if @user.nil? - message += (_("

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 (details).

") % [help_privacy_path+"#email_address"]).html_safe; + message += _("

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 (details).

", :url => (help_privacy_path+"#email_address").html_safe); else - message += (_("

You do not need to include your email in the request in order to get a reply (details).

") % [help_privacy_path+"#email_address"]).html_safe; + message += _("

You do not need to include your email in the request in order to get a reply (details).

", :url => (help_privacy_path+"#email_address").html_safe); end message += _("

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.

") @@ -333,7 +333,7 @@ class RequestController < ApplicationController message += _("

Your request contains a postcode. Unless it directly relates to the subject of your request, please remove any address as it will appear publicly on the Internet.

"); end if not message.empty? - flash.now[:error] = message + flash.now[:error] = message.html_safe end render :action => 'preview' return -- cgit v1.2.3 From dc0f6181e445a64cd14f6c5bb5e052dc320cd956 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 21 Jan 2013 19:30:39 +0000 Subject: Use {{}} not %s in translation. --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index cbd6543cb..bf9e6c689 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -625,7 +625,7 @@ class RequestController < ApplicationController 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 contact us if you really want to send a follow up message.') % [help_contact_path]).html_safe + flash[:error] = _('Your follow up has not been sent because this request has been stopped to prevent spam. Please contact us if you really want to send a follow up message.', :url => help_contact_path.html_safe) 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.') -- cgit v1.2.3