aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/services_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-05-15 16:09:29 +0100
committerLouise Crow <louise.crow@gmail.com>2014-05-15 16:09:29 +0100
commit26348ce676f7ebbabcc535b2ecf00f99f8fe85c0 (patch)
tree6034dd656a0f9af152f24d6c491b5e61a7190a7d /app/controllers/services_controller.rb
parent851ef575cf3c55a3bb194381497b958c2a3ebf1a (diff)
parentb3fa23047bf96bd6a08273c9491ac1ee3b4a3f80 (diff)
Merge branch 'release/0.18' into wdtk
Diffstat (limited to 'app/controllers/services_controller.rb')
-rw-r--r--app/controllers/services_controller.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 78c494dba..97c47c448 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -17,8 +17,15 @@ class ServicesController < ApplicationController
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>".html_safe)
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)
+ country_data = WorldFOIWebsites.by_code(iso_country_code)
+ if country_data
+ text = _("Hello! We have an <a href=\"{{url}}\">important message</a> for visitors outside {{country_name}}",
+ :country_name => country_data[:country_name],
+ :url => "/help/alaveteli?country_name=#{CGI.escape(country_data[:country_name])}")
+ else
+ text = _("Hello! We have an <a href=\"{{url}}\">important message</a> for visitors in other countries",
+ :url => "/help/alaveteli")
+ end
end
ensure
FastGettext.locale = old_fgt_locale