lib/globalize-validations/concern.rb
# Return all translated attributes with errors for the given locales,
# including their error messages
Return all translated attributes with errors for the given locales,
including their error messages
Return all translated attributes with errors for the given locales including their error messages
def globalized_errors_for_locales(attribute_names, locales)
        locales.map!(&:to_s)
        additional_locales = locales - [I18n.locale.to_s]
        if locales.include? I18n.locale.to_s
          globalized_errors_for_locale(attribute_names, I18n.locale)
        end
        additional_locales.each do |locale|
          Globalize.with_locale(locale) do
            globalized_errors_for_locale(attribute_names, locale) if invalid?
          end
        end
      end
def globalized_errors_for_locales ( attribute_names , locales ) locales . map! ( & :to_s ) additional_locales = locales - [ I18n . locale . to_s ] if locales . include? I18n . locale . to_s globalized_errors_for_locale ( attribute_names , I18n . locale ) end additional_locales . each do | locale | Globalize . with_locale ( locale ) do globalized_errors_for_locale ( attribute_names , locale ) if invalid? end end end
Return all translated attributes with errors for the given locales,
including their error messages
Return all translated attributes with errors for the given locales including their error messages
# Track errors for current locale # Validates the given object against each locale except the current one # and track their errors
attribute_names
<not_specific>
locales
<not_specific>