You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: search_configurations_helper.rb
    path of file: ./repos/spotlight/app/helpers/spotlight
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Spotlight
  ##
  # Search configurations helpers
  module SearchConfigurationsHelper
    ##
    # Translate a sort field configuration into
    # a complete description of the sort
    def translate_sort_fields(sort_config)
      sort_description = sort_config[:sort_description] if sort_config[:sort_description]

      if sort_config[:sort]
        sort_description ||= sort_config[:sort].split(',').map do |sort|
          sort_field, sort_order = sort.split(' ')
          safe_join([
              
    
    def translate_sort_fields(sort_config)
      sort_description = sort_config[:sort_description] if sort_config[:sort_description]

      if sort_config[:sort]
        sort_description ||= sort_config[:sort].split(',').map do |sort|
          sort_field, sort_order = sort.split(' ')
          safe_join([
                      t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
                      t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
                    ], ' ')
        end.to_sentence
      end

      sort_description
    end