diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-10-19 07:38:21 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-10-19 07:38:21 +1100 |
commit | 51f4bc36b65a6d4aaba6233bd5caba39f3215ee5 (patch) | |
tree | 71a7cd1a435ab4765d0979fa7720ce019bf10b40 /app/controllers/services_controller.rb | |
parent | f5dd6615bd0f5443cf98dca1472bbc620da1af32 (diff) |
Inline temporary variable
Diffstat (limited to 'app/controllers/services_controller.rb')
-rw-r--r-- | app/controllers/services_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ead5d73b7..5156f3416 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -9,13 +9,12 @@ 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] + 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) |