Fix wrong displayed field in current locale
Conflicts: vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/_questions.html.erb
This commit is contained in:
parent
14b742b022
commit
291a16585b
|
@ -1,52 +0,0 @@
|
|||
From 427c24be97de625b2dc3de95048d8a8aa0a81577 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <427c24be97de625b2dc3de95048d8a8aa0a81577.1387872856.git.saurabh.a.bhatia@gmail.com>
|
||||
From: thomaschen <99703040@nccu.edu.tw>
|
||||
Date: Tue, 24 Dec 2013 16:09:58 +0800
|
||||
Subject: [PATCH] add translation for terms of use frontpage ui
|
||||
|
||||
---
|
||||
app/controllers/front_controller.rb | 2 +-
|
||||
config/locales/en.yml | 1 +
|
||||
config/locales/zh_tw.yml | 1 +
|
||||
3 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb
|
||||
index 9fb1d5a..a5b3780 100644
|
||||
--- a/app/controllers/front_controller.rb
|
||||
+++ b/app/controllers/front_controller.rb
|
||||
@@ -17,7 +17,7 @@ class FrontController < ApplicationController
|
||||
@url = "/#{@name}" if @name.present?
|
||||
|
||||
if (!@site.enable_terms_of_use && @page.first.present?)
|
||||
- render :text => (@site.footer + "<a href='#{@url}'>Terms of Use</a>")
|
||||
+ render :text => (@site.footer + "<a href='#{@url}'>#{t(:terms_of_use)}</a>")
|
||||
else
|
||||
render :text => @site.footer
|
||||
end
|
||||
diff --git a/config/locales/en.yml b/config/locales/en.yml
|
||||
index 9e9e7d8..08894af 100644
|
||||
--- a/config/locales/en.yml
|
||||
+++ b/config/locales/en.yml
|
||||
@@ -484,6 +484,7 @@ en:
|
||||
template: Template
|
||||
templates: Templates
|
||||
template_name: Template name
|
||||
+ terms_of_use: Terms of Use
|
||||
text: Text
|
||||
theme: Theme
|
||||
themes: Themes
|
||||
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
|
||||
index 7342e17..ca81e12 100644
|
||||
--- a/config/locales/zh_tw.yml
|
||||
+++ b/config/locales/zh_tw.yml
|
||||
@@ -485,6 +485,7 @@ zh_tw:
|
||||
template: 樣版
|
||||
templates: 網站模版
|
||||
template_name: 樣版名稱
|
||||
+ terms_of_use: 使用規則
|
||||
text: 內文
|
||||
theme: 套用頁面樣式
|
||||
themes: 主題
|
||||
--
|
||||
1.8.3.2
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
{{if _id}}
|
||||
<input id="${_id[0]}" name="${_id[1]}" type="hidden" value="${_id[2]}">
|
||||
{{/if}}
|
||||
<h4><b></b> Q<span>${_length}</span> <i class="icon-caret-up"></i> <span class="questions-title">${_title_translations[3].<%= I18n.locale.to_s %>}</span></h4>
|
||||
|
||||
<h4><b></b> Q<span>${_length}</span> <i class="icon-caret-up"></i> <span class="questions-title">${_title_translations[3].<%= @primary_locale %>}</span></h4>
|
||||
</div>
|
||||
<div class="attributes-body">
|
||||
<div class="control-group">
|
||||
|
@ -15,21 +16,12 @@
|
|||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<div class="tab-content">
|
||||
<% if I18n.locale == :en %>
|
||||
<div class="tab-pane fade active in" id="${_title_translations[2]+'_en'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_en'}" name="${_title_translations[1]+'[en]'}" type="text" value="${_title_translations[3].en}" />
|
||||
<div class="tab-pane fade active in" id="${_title_translations[2]+'_<%= @primary_locale %>'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_<%= @primary_locale %>'}" name="${_title_translations[1]+'[<%= @primary_locale %>]'}" type="text" value="${_title_translations[3].<%= @primary_locale %>}" />
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_title_translations[2]+'_zh_tw'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_zh_tw'}" name="${_title_translations[1]+'[zh_tw]'}" type="text" value="${_title_translations[3].zh_tw}" />
|
||||
<div class="tab-pane fade" id="${_title_translations[2]+'_<%= @secondary_locale %>'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_<%= @secondary_locale %>'}" name="${_title_translations[1]+'[<%= @secondary_locale %>]'}" type="text" value="${_title_translations[3].<%= @secondary_locale %>}" />
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="tab-pane fade active in" id="${_title_translations[2]+'_zh_tw'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_zh_tw'}" name="${_title_translations[1]+'[zh_tw]'}" type="text" value="${_title_translations[3].zh_tw}" />
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_title_translations[2]+'_en'}">
|
||||
<input class="span4 q-title" id="${_title_translations[0]+'_en'}" name="${_title_translations[1]+'[en]'}" type="text" value="${_title_translations[3].en}" />
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% if I18n.locale == :zh_tw %>
|
||||
|
@ -56,21 +48,12 @@
|
|||
<a class="btn" href="${'#'+_description_translations[2]+'_zh_tw'}" data-toggle="tab"><%= I18nVariable.from_locale('zh_tw') %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if I18n.locale == :en %>
|
||||
<div class="tab-pane fade active in" id="${_description_translations[2]+'_en'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_en'}" name="${_description_translations[1]+'[en]'}" rows="3">${_description_translations[3].en}</textarea>
|
||||
<div class="tab-pane fade active in" id="${_description_translations[2]+'_<%= @primary_locale %>'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_<%= @primary_locale %>'}" name="${_description_translations[1]+'[<%= @primary_locale %>]'}" rows="3">${_description_translations[3].<%= @primary_locale %>}</textarea>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_description_translations[2]+'_zh_tw'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_zh_tw'}" name="${_description_translations[1]+'[zh_tw]'}" rows="3">${_description_translations[3].zh_tw}</textarea>
|
||||
<div class="tab-pane fade" id="${_description_translations[2]+'_<%= @secondary_locale %>'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_<%= @secondary_locale %>'}" name="${_description_translations[1]+'[<%= @secondary_locale %>]'}" rows="3">${_description_translations[3].<%= @secondary_locale %>}</textarea>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="tab-pane fade active in" id="${_description_translations[2]+'_zh_tw'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_zh_tw'}" name="${_description_translations[1]+'[zh_tw]'}" rows="3">${_description_translations[3].zh_tw}</textarea>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_description_translations[2]+'_en'}">
|
||||
<textarea class="resizable" id="${_description_translations[0]+'_en'}" name="${_description_translations[1]+'[en]'}" rows="3">${_description_translations[3].en}</textarea>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -157,11 +140,11 @@
|
|||
<input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
|
||||
{{/if}}
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="${_radiogroups[2]+'en'}">
|
||||
<input type="text" class="span4" id="${_radiogroups[0]+'en'}" name="${_radiogroups[1]+'[en]'}" value="${_radiogroups[3].en}" />
|
||||
<div class="tab-pane fade active in" id="${_radiogroups[2]+'<%= @primary_locale %>'}">
|
||||
<input type="text" class="span4" id="${_radiogroups[0]+'<%= @primary_locale %>'}" name="${_radiogroups[1]+'[<%= @primary_locale %>]'}" value="${_radiogroups[3].<%= @primary_locale %>}" />
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_radiogroups[2]+'zh_tw'}">
|
||||
<input type="text" class="span4" id="${_radiogroups[0]+'zh_tw'}" name="${_radiogroups[1]+'[zh_tw]'}" value="${_radiogroups[3].zh_tw}" />
|
||||
<div class="tab-pane fade" id="${_radiogroups[2]+'<%= @secondary_locale %>'}">
|
||||
<input type="text" class="span4" id="${_radiogroups[0]+'<%= @secondary_locale %>'}" name="${_radiogroups[1]+'[<%= @secondary_locale %>]'}" value="${_radiogroups[3].<%= @secondary_locale %>}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
|
@ -179,11 +162,11 @@
|
|||
<input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
|
||||
{{/if}}
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="${_option[2]+'en'}">
|
||||
<input type="text" class="span4" id="${_option[0]+'en'}" name="${_option[1]+'[en]'}" value="${_option[3].en}" />
|
||||
<div class="tab-pane fade active in" id="${_option[2]+'<%= @primary_locale %>'}">
|
||||
<input type="text" class="span4" id="${_option[0]+'<%= @primary_locale %>'}" name="${_option[1]+'[<%= @primary_locale %>]'}" value="${_option[3].<%= @primary_locale %>}" />
|
||||
</div>
|
||||
<div class="tab-pane fade" id="${_option[2]+'zh_tw'}">
|
||||
<input type="text" class="span4" id="${_option[0]+'zh_tw'}" name="${_option[1]+'[zh_tw]'}" value="${_option[3].zh_tw}" />
|
||||
<div class="tab-pane fade" id="${_option[2]+'<%= @secondary_locale %>'}">
|
||||
<input type="text" class="span4" id="${_option[0]+'<%= @secondary_locale %>'}" name="${_option[1]+'[<%= @secondary_locale %>]'}" value="${_option[3].<%= @secondary_locale %>}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
|
|
Reference in New Issue