diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/public/js/taginfo.js | 1 | ||||
-rwxr-xr-x | web/taginfo.rb | 2 | ||||
-rw-r--r-- | web/views/layout.erb | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index ec5a372..f68f51f 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -366,6 +366,7 @@ jQuery(document).ready(function() { } jQuery('#locale').bind('change', function() { + jQuery('#url').val(window.location); jQuery('#set_language').submit(); }); diff --git a/web/taginfo.rb b/web/taginfo.rb index 7cba07c..0739268 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -141,7 +141,7 @@ class Taginfo < Sinatra::Base # It sets a cookie and redirects back to the page the user was coming from. get '/switch_locale' do response.set_cookie('taginfo_locale', params[:locale]) - redirect(TaginfoConfig.get('instance.url') + params[:url]) + redirect(params[:url]) end #------------------------------------- diff --git a/web/views/layout.erb b/web/views/layout.erb index ba71b91..de81b0c 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -17,7 +17,7 @@ </div> <div id="header_forms" class="no-print"> <form id="set_language" action="/switch_locale"> - <input type="hidden" name="url" value="<%= request.path %>"/> + <input type="hidden" id="url" name="url" value="<%= TaginfoConfig.get('instance.url') + request.path %>"/> <select id="locale" name="locale"> <% r18n.available_locales.sort{ |a,b| a.title <=> b.title }.each do |locale| %> <option value="<%= locale.code %>"<%= locale.code == r18n.locale.code ? ' selected="selected"' : ''%>><%= locale.title %> </option> |