<commit_before>module Localization
  mattr_accessor :lang
  
  @@l10s = { :default => {} }
  @@lang = :default
  
  def self._(string_to_localize, *args)
    translated = @@l10s[@@lang][string_to_localize] ? string_to_localize : @@l10s[@@lang][string_to_localize]
    return translated.call(*args).to_s  if translated.is_a? Proc
    if translated.is_a? Array
      translated = if translated.size == 3 
        translated[args[0]==0 ? 0 : (args[0]>1 ? 2 : 1)]
      else
        translated[args[0]>1 ? 1 : 0]
      end
    end
    sprintf translated, *args
  end
  
  def self.__(string_to_localize, *args)
    translated = @@l10s[@@lang][string_to_localize] ? string_to_localize : @@l10s[@@lang][string_to_localize]
    return translated.call(*args).to_s  if translated.is_a? Proc
    if translated.is_a? Array
      translated = if translated.size == 3 
        translated[args[0]==0 ? 0 : (args[0]>1 ? 2 : 1)]
      else
        translated[args[0]>1 ? 1 : 0]
      end
    end
    translated
  end
  
  def self.define(lang = :default)
    @@l10s[lang] ||= {}<commit_msg>Fixing a bug when localization string is not declared inside the localization file<commit_after>module Localization
  mattr_accessor :lang
  
  @@l10s = { :default => {} }
  @@lang = :default
  
  def self._(string_to_localize, *args)
    translated = @@l10s[@@lang][string_to_localize].nil? ? string_to_localize : @@l10s[@@lang][string_to_localize]
    return translated.call(*args).to_s  if translated.is_a? Proc
    if translated.is_a? Array
      translated = if translated.size == 3 
        translated[args[0]==0 ? 0 : (args[0]>1 ? 2 : 1)]
      else
        translated[args[0]>1 ? 1 : 0]
      end
    end
    sprintf translated, *args
  end
  
  def self.__(string_to_localize, *args)
    translated = @@l10s[@@lang][string_to_localize].nil? ? string_to_localize : @@l10s[@@lang][string_to_localize]
    return translated.call(*args).to_s  if translated.is_a? Proc
    if translated.is_a? Array
      translated = if translated.size == 3 
        translated[args[0]==0 ? 0 : (args[0]>1 ? 2 : 1)]
      else
        translated[args[0]>1 ? 1 : 0]
      end
    end
    translated
  end
  
  def self.define(lang = :default)
    @@l10s[lang] ||= {}
{'fraction_non_alphanumeric': 0.1383026493039964, 'fraction_numerical': 0.032330489447687474, 'mean_word_length': 3.088073394495413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '363706', 'n_tokens_mistral': 846, 'n_tokens_neox': 779, 'n_words': 168}