lib/tasks/i18n_missing_keys.rake
# Returns true if key exists in the given locale
Returns true if key exists in the given locale
Returns true if key exists in the given locale
def key_exists?(key, locale)
    I18n.locale = locale
    I18n.t(key, raise: true)
    true
  rescue I18n::MissingInterpolationArgument
    true
  rescue I18n::MissingTranslationData
    false
  end
def key_exists? ( key , locale ) I18n . locale = locale I18n . t ( key , raise : true ) true rescue I18n :: MissingInterpolationArgument true rescue I18n :: MissingTranslationData false end
Returns true if key exists in the given locale
Returns true if key exists in the given locale
key
<not_specific>
locale
<not_specific>