From 5f50d5933311ee3304fe28166aa885b88ba4796a Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 8 Aug 2014 11:46:21 +0800 Subject: [PATCH] fix switch_language --- app/helpers/application_helper.rb | 2 +- app/views/orbit_bar/index.html.erb | 2 +- config/locales/zh_tw.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7387cef..e6ec11e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/views/orbit_bar/index.html.erb b/app/views/orbit_bar/index.html.erb index 526dee9..8b8e522 100644 --- a/app/views/orbit_bar/index.html.erb +++ b/app/views/orbit_bar/index.html.erb @@ -90,7 +90,7 @@
  • "> <%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %>
  • - <% 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/") %>
  • "> <%= t(:zh_cn, :locale => :zh_tw) %>
  • diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 7f61e5b..1d5ba01 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -217,6 +217,7 @@ zh_tw: end_date: 結束日期 errors: at_least_one: 至少擁有一個值 + expired: 已結束 field: 欄位 file: size: 檔案大小