aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/link_to_helper.rb6
-rw-r--r--app/views/layouts/default.rhtml14
-rw-r--r--public/stylesheets/main.css13
3 files changed, 32 insertions, 1 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 93151ecfe..85913b12e 100644
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -197,6 +197,12 @@ module LinkToHelper
return date.strftime("%Y").strip
end
+ #I18n locale switcher
+
+ def locale_switcher(locale, params)
+ params['locale'] = locale
+ return url_for(params)
+ end
end
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 97ee7bd51..60699fe5c 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -87,10 +87,24 @@
<div id="tagline">
<%= _('Make and explore Freedom of Information requests') %>
</div>
+ <% if FastGettext.default_available_locales.length > 1 %>
+ <div id="user_locale_switcher">
+ Language:
+ <% for possible_locale in FastGettext.default_available_locales %>
+ <% if possible_locale == I18n.locale.to_s %>
+ <%= possible_locale %>
+ <% else %>
+ <a href="<%= locale_switcher(possible_locale, params) %>"><%= possible_locale %></a>
+ <% end %>
+ <% end %>
+ </div>
+ <% end %>
+
</div>
<div id="orglogo">
<%= render :partial => 'general/orglink' %>
</div>
+
<div id="navigation_search">
<% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>
<p>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index cb422b53c..af52640f7 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -36,13 +36,14 @@ body
left: 14px;
height: 55px;
width: 500px;
- z-index: 150;
+ z-index: 200;
text-align: left;
}
#header h1
{
font-size: 0.8em;
line-height: 0em;
+ margin: 0;
}
#header h1 a
@@ -62,6 +63,16 @@ body
margin: 2px 0 0 0;
color: #626262;
}
+
+ #header #user_locale_switcher
+ {
+ font-size: 0.8em;
+ font-style: italic;
+ text-align: left;
+ margin: 2px 0 0 0;
+ color: #626262;
+ position: absolute;
+ }
/*------------------------------------------------ temp stuff */
#staging, #alpha_notice, #beta
{ }