<commit_before>module Forem
  module Admin
    class TopicsController < BaseController
      before_filter :find_topic

      def edit
      end

      def update
        @topic.subject = params[:topic][:subject]
        @topic.pinned  = params[:topic][:pinned]
        @topic.locked  = params[:topic][:locked]
        @topic.hidden  = params[:topic][:hidden]
        if @topic.save
          flash[:notice] = t("forem.admin.topic.updated")
          redirect_to forum_topic_path(@topic.forum, @topic)
        else
          flash[:error] = t("forem.admin.topic.not_updated")
          render :action => "edit"
        end
      end

      def destroy
        forum = @topic.forum
        @topic.destroy
        flash[:notice] = t("forem.admin.topic.deleted")
        redirect_to forum_topics_path(forum)
      end

      private
        def find_topic
          @topic = Forem::Topic.find(params[:id])
        end
    end
  end
end<commit_msg>Fix translation strings in admin/topics_controller<commit_after>module Forem
  module Admin
    class TopicsController < BaseController
      before_filter :find_topic

      def edit
      end

      def update
        @topic.subject = params[:topic][:subject]
        @topic.pinned  = params[:topic][:pinned]
        @topic.locked  = params[:topic][:locked]
        @topic.hidden  = params[:topic][:hidden]
        if @topic.save
          flash[:notice] = t("forem.topic.updated")
          redirect_to forum_topic_path(@topic.forum, @topic)
        else
          flash[:error] = t("forem.topic.not_updated")
          render :action => "edit"
        end
      end

      def destroy
        forum = @topic.forum
        @topic.destroy
        flash[:notice] = t("forem.topic.deleted")
        redirect_to forum_topics_path(forum)
      end

      private
        def find_topic
          @topic = Forem::Topic.find(params[:id])
        end
    end
  end
end
{'fraction_non_alphanumeric': 0.108023072889355, 'fraction_numerical': 0.0, 'mean_word_length': 2.1125611745513866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '668178', 'n_tokens_mistral': 568, 'n_tokens_neox': 555, 'n_words': 115}