def process_localized_attributes(klass, attrs)
      klass.localized_fields.keys.each do |name|
        if value = attrs.delete(name)
          attrs["#{name}_translations"] = value
        end
      end
      klass.embedded_relations.each do |_, association|
        next unless attrs.present? && attrs[association.key].present?

        if association.is_a?(Association::Embedded::EmbedsMany)
          attrs[association.key].each do |attr|
            embedded_klass = attr.fetch('_type', association.class_name).constantize
            process_localized_attributes(embedded_klass, attr)
          end
        else
          process_localized_attributes(association.klass, attrs[association.key])
        end
      end
    end
def process_localized_attributes(klass, attrs)
      klass.localized_fields.keys.each do |name|
        if value = attrs.delete(name)
          attrs["#{name}_translations"] = value
        end
      end
      klass.embedded_relations.each do |_, association|
        next unless attrs.present? && attrs[association.key].present?

        if association.is_a?(Association::Embedded::EmbedsMany)
          attrs[association.key].each do |attr|
            embedded_klass = attr.fetch('_type', association.class_name).constantize
            process_localized_attributes(embedded_klass, attr)
          end
        else
          process_localized_attributes(association.klass, attrs[association.key])
        end
      end
    end
When cloning, if the document has localized fields we need to ensure they
 are properly processed in the clone.

 @api private

 @example Process localized attributes.
   model.process_localized_attributes(attributes)

 @param [ Hash ] attrs The attributes.

 @since 3.0.20