fix switch_language

This commit is contained in:
manson 2014-08-08 11:46:21 +08:00
parent b4e5d36cc3
commit 5f50d59333
3 changed files with 3 additions and 2 deletions

View File

@ -353,7 +353,7 @@ module ApplicationHelper
url = url.gsub("/#{locale.to_s}/","/#{loc.to_s}/")
url = url.gsub("locale=#{locale.to_s}","locale=#{loc.to_s}") if url == request.original_fullpath
url = url + "#{url.include?("?") ? "&" : "?"}locale=#{loc.to_s}" if url == request.original_fullpath and !url.include?(locale.to_s)
url = url + "#{url.include?("?") ? "&" : "?"}locale=#{loc.to_s}" if url == request.original_fullpath and (!url.include?('/'+locale.to_s) or !url.include?(locale.to_s+'='))
url
end

View File

@ -90,7 +90,7 @@
<li class="<%= (l == I18n.locale and !session['zh_cn']) ? "active" : "" %>">
<a href="<%= switch_language(l) %>"><%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %></a>
</li>
<% if current_site.enable_zh_cn and l == :zh_tw %>
<% if current_site.enable_zh_cn and l == :zh_tw and !request.path.include?("/admin/") %>
<li class="<%= locale==:zh_cn ? "active" : "" %>">
<a href="<%= switch_language(:zh_cn) %>"><%= t(:zh_cn, :locale => :zh_tw) %></a>
</li>

View File

@ -217,6 +217,7 @@ zh_tw:
end_date: 結束日期
errors:
at_least_one: 至少擁有一個值
expired: 已結束
field: 欄位
file:
size: 檔案大小