aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/services_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-11-12 15:06:46 +0000
committerLouise Crow <louise.crow@gmail.com>2012-11-12 15:06:46 +0000
commita1ca0f9123a3aea843ba35508a97d5a4fd5cb0db (patch)
treeb9d3c1390f6b9c8b201e47507f26829b239f2773 /app/controllers/services_controller.rb
parent8271b2c664f04d1b68a8b4d4fdb801f5c6b00b8c (diff)
parentc96b27c301023a6a1f50c12f0c387205b0255836 (diff)
Merge remote-tracking branch 'origin/release/0.6.8'0.6.8
Conflicts: locale/cs/app.po locale/sl/app.po locale/sq/app.po locale/tr/app.po locale/uk/app.po
Diffstat (limited to 'app/controllers/services_controller.rb')
-rw-r--r--app/controllers/services_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index ead5d73b7..38bf51772 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -9,13 +9,13 @@ class ServicesController < ApplicationController
iso_country_code = Configuration::iso_country_code.downcase
if country_from_ip.downcase != iso_country_code
found_country = WorldFOIWebsites.by_code(country_from_ip)
- found_country_name = !found_country.nil? && found_country[:country_name]
old_fgt_locale = FastGettext.locale
begin
FastGettext.locale = FastGettext.best_locale_in(request.env['HTTP_ACCEPT_LANGUAGE'])
- if found_country_name
- text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_country_name, :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
+ if found_country && found_country[:country_name] && found_country[:url] && found_country[:name]
+ text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}",
+ :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
else
current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name]
text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country)