From 2b326acc32d5d89119038b21f390eccf8029c305 Mon Sep 17 00:00:00 2001
From: Tom Hughes
Date: Tue, 14 Feb 2012 11:54:22 +0000
Subject: [PATCH] Allow the copyright page to be requested in any locale
---
app/controllers/site_controller.rb | 4 ++++
app/views/site/copyright.html.erb | 12 +++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index 36f57d6c2..f0c686c9f 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.rb
@@ -80,4 +80,8 @@ class SiteController < ApplicationController
@zoom = '17' if @zoom.nil?
end
end
+
+ def copyright
+ @locale = params[:copyright_locale] || I18n.locale
+ end
end
diff --git a/app/views/site/copyright.html.erb b/app/views/site/copyright.html.erb
index c83cef99c..03dee8716 100644
--- a/app/views/site/copyright.html.erb
+++ b/app/views/site/copyright.html.erb
@@ -10,9 +10,9 @@
{ :rel => "license" }) %>
-<% if I18n.locale == 'en' or params[:copyright_locale] == 'en' %>
+<% if @locale == 'en' %>
- <% if t('license_page.legal_babble') != t('license_page.legal_babble', :locale => :en) %>
+ <% if t('license_page.legal_babble', :locale => I18n.locale) != t('license_page.legal_babble', :locale => :en) %>
<%= t 'license_page.native.title' %>
<%= raw t 'license_page.native.text',
@@ -25,11 +25,9 @@
<% end %>
-
- <%= raw t('license_page.legal_babble', :locale => :en) %>
<% else %>
- <% if t('license_page.legal_babble') != t('license_page.legal_babble', :locale => :en) %>
+ <% if t('license_page.legal_babble', :locale => @locale) != t('license_page.legal_babble', :locale => :en) %>
<%= t 'license_page.foreign.title' %>
<%= raw t 'license_page.foreign.text',
@@ -40,6 +38,6 @@
<% end %>
-
- <%= raw t('license_page.legal_babble') %>
<% end %>
+
+<%= raw t('license_page.legal_babble', :locale => @locale) %>
--
2.39.5