diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/link_to_helper.rb | 6 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 14 |
2 files changed, 20 insertions, 0 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> |