<commit_before>module ActiveAdmin
  class Resource
    module Naming

      # An underscored safe representation internally for this resource
      def underscored_resource_name
        @underscored_resource_name ||= if @options[:as]
          @options[:as].gsub(' ', '').underscore.singularize
        else
          resource.name.gsub('::','').underscore
        end
      end

      # A camelized safe representation for this resource
      def camelized_resource_name
        underscored_resource_name.camelize
      end

      # Returns the name to call this resource.
      # By default will use resource.model_name.human
      def resource_name
        @resource_name ||= if @options[:as] || !resource.respond_to?(:model_name)
          underscored_resource_name.titleize
        else
          resource.model_name.human.titleize
        end
      end

      # Returns the plural version of this resource
      def plural_resource_name
        @plural_resource_name ||= resource_name.pluralize
      end

    end
  end
end
<commit_msg>use model_name.human to implement plural_resource_name so that it plays well with i18n<commit_after>module ActiveAdmin
  class Resource
    module Naming

      # An underscored safe representation internally for this resource
      def underscored_resource_name
        @underscored_resource_name ||= if @options[:as]
          @options[:as].gsub(' ', '').underscore.singularize
        else
          resource.name.gsub('::','').underscore
        end
      end

      # A camelized safe representation for this resource
      def camelized_resource_name
        underscored_resource_name.camelize
      end

      # Returns the name to call this resource.
      # By default will use resource.model_name.human
      def resource_name
        @resource_name ||= if @options[:as] || !resource.respond_to?(:model_name)
          underscored_resource_name.titleize
        else
          resource.model_name.human.titleize
        end
      end

      # Returns the plural version of this resource
      def plural_resource_name
        @plural_resource_name ||= if @options[:as] || !resource.respond_to?(:model_name)
          @resource_name.pluralize
        else
          resource.model_name.human(:count => 3)
        end
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.07096212451023073, 'fraction_numerical': 0.00130605137135394, 'mean_word_length': 2.4871016691957513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2537762', 'n_tokens_mistral': 644, 'n_tokens_neox': 619, 'n_words': 166}