From 14b742b022a200c5b7e81ce96c05d0840937d31d 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 5b44ac47..c9788cbf 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 @@ -165,8 +165,8 @@
- English - Chinese + <%= I18nVariable.from_locale(@primary_locale) %> + <%= I18nVariable.from_locale(@secondary_locale) %> @@ -187,8 +187,8 @@
- English - Chinese + <%= I18nVariable.from_locale(@primary_locale) %> + <%= I18nVariable.from_locale(@secondary_locale) %>