lib/missing_translation_detector.rb
def detect(h = @base, keys = [])
    h.each_key do |key|
      key_path = keys.clone.push key

      if h[key].is_a?(Hash)
        detect h[key], key_path
      elsif blank?(key_path)
        missing_translations << OpenStruct.new(key_path: key_path,
                                               value: h[key])
      end
    end
  end
# Detects missing translations within the target locale file
# and stores it in "missing_translations".
Detects missing translations within the target locale file
and stores it in "missing_translations".
Detects missing translations within the target locale file and stores it in " missing_translations " .
def detect(h = @base, keys = [])
    h.each_key do |key|
      key_path = keys.clone.push key
      if h[key].is_a?(Hash)
        detect h[key], key_path
      elsif blank?(key_path)
        missing_translations << OpenStruct.new(key_path: key_path,
                                               value: h[key])
      end
    end
  end
def detect ( h = @base , keys = [ ] ) h . each_key do | key | key_path = keys . clone . push key if h [ key ] . is_a? ( Hash ) detect h [ key ] , key_path elsif blank? ( key_path ) missing_translations << OpenStruct . new ( key_path : key_path , value : h [ key ] ) end end end
Detects missing translations within the target locale file
and stores it in "missing_translations".
Detects missing translations within the target locale file and stores it in " missing_translations " .
h
keys