lib/mongoid/slug.rb
def all_locales
      locales = slugged_attributes
                .map { |attr| send("#{attr}_translations").keys if respond_to?("#{attr}_translations") }
                .flatten.compact.uniq
      locales = I18n.available_locales if locales.empty?
      locales
    end
def all_locales
      locales = slugged_attributes
                .map { |attr| send("#{attr}_translations").keys if respond_to?("#{attr}_translations") }
                .flatten.compact.uniq
      locales = I18n.available_locales if locales.empty?
      locales
    end
Return all possible locales for model
 Avoiding usage of I18n.available_locales in case the user hasn't set it properly, or is
 doing something crazy, but at the same time we need a fallback in case the model doesn't
 have any localized attributes at all (extreme edge case).