<commit_before>module ActiveEnumeration
  class Base
    attr_reader :id, :key, :name

    def initialize(*args)
      options = args.extract_options!
      @key = args.first.to_sym
      @id = @key.to_s.hash
      @name = options.delete(:name) || key.to_s
      options.each do |key, value|
        self.instance_variable_set("@#{key}", value)
        self.class_eval do
          attr_reader key.to_sym
        end
      end<commit_msg>Updated to use I18n properly<commit_after>module ActiveEnumeration
  class Base
    attr_reader :id, :key, :translate_key

    def initialize(*args)
      options = args.extract_options!
      @key = args.first.to_sym
      @id = @key.to_s.hash
      @name = options.delete(:name) || key.to_s
      @translate_key = options.delete(:translate_key)
      options.each do |key, value|
        self.instance_variable_set("@#{key}", value)
        self.class_eval do
          attr_reader key.to_sym
        end
      end
    end
    
    def name
      @translate_key ? I18n.t(@translate_key, @name) : @name
{'fraction_non_alphanumeric': 0.10758885686839577, 'fraction_numerical': 0.0038424591738712775, 'mean_word_length': 2.4966442953020134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3842574', 'n_tokens_mistral': 338, 'n_tokens_neox': 335, 'n_words': 74}