From c86fb937026cabe37fdfb153e139757776321f84 Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Tue, 31 Dec 2013 11:27:49 +0800 Subject: [PATCH] Fix added option field to sync with primary locale --- .../panel/survey/back_end/surveys_controller.rb | 4 ++++ .../panel/survey/back_end/surveys/_questions.html.erb | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/vendor/built_in_modules/survey/app/controllers/panel/survey/back_end/surveys_controller.rb b/vendor/built_in_modules/survey/app/controllers/panel/survey/back_end/surveys_controller.rb index 9052d26f..7b315146 100644 --- a/vendor/built_in_modules/survey/app/controllers/panel/survey/back_end/surveys_controller.rb +++ b/vendor/built_in_modules/survey/app/controllers/panel/survey/back_end/surveys_controller.rb @@ -22,6 +22,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController def new @survey = ::Survey.new + @primary_locale = I18n.locale.to_s + @secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw" respond_to do |format| format.html # new.html.erb @@ -47,6 +49,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController end def edit + @primary_locale = I18n.locale.to_s + @secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw" @survey = ::Survey.find(params[:id]) @sqs = [] @survey.survey_questions.each do |sq| diff --git a/vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/_questions.html.erb b/vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/_questions.html.erb index bd61bc2f..13c35111 100644 --- a/vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/_questions.html.erb +++ b/vendor/built_in_modules/survey/app/views/panel/survey/back_end/surveys/_questions.html.erb @@ -147,8 +147,8 @@
- English - Chinese + <%= I18nVariable.from_locale(@primary_locale) %> + <%= I18nVariable.from_locale(@secondary_locale) %> @@ -169,8 +169,8 @@
- English - Chinese + <%= I18nVariable.from_locale(@primary_locale) %> + <%= I18nVariable.from_locale(@secondary_locale) %>