diff --git a/app/controllers/user_tags_controller.rb b/app/controllers/user_tags_controller.rb index 09f4898c62..4b61ad8dc4 100644 --- a/app/controllers/user_tags_controller.rb +++ b/app/controllers/user_tags_controller.rb @@ -68,6 +68,9 @@ def create else @output[:errors] << I18n.t('user_tags_controller.value_cannot_be_empty') end + if params[:translationswitch] + redirect_to URI.parse('/change_locale/zh-CN').path and return + end else @output[:errors] << I18n.t('user_tags_controller.admin_user_manage_tags') end @@ -105,6 +108,10 @@ def delete output[:errors] = I18n.t('user_tags_controller.tag_doesnt_exist') end + if params[:translationswitch] + redirect_to URI.parse('/change_locale/en').path and return + end + output[:tid] = @user_tag&.id if request.xhr? render json: output diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index c5d7ec2405..c8609cf3b1 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -163,6 +163,22 @@ Features
<% end %> + + <% if Rails.env==="development" %> + <% if current_user %> + <% if current_user&.has_tag('translation-helper') %> + + Switch off Translation + + <% else %> + + Switch on Translation + + <% end %> + + <% end %> + <% end %> + <% if current_user&.has_tag('translation-helper') && I18n.locale != :en %>