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: flatten.rb
    path of file: ./repos/i18n/lib/i18n/backend
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module I18n
  module Backend
    # This module contains several helpers to assist flattening translations.
    # You may want to flatten translations for:
    #
    #   1) 
    
      def flatten_translations(locale, data, escape, subtree)
        hash = {}
        flatten_keys(data, escape) do |key, value|
          if value.is_a?(Hash)
            hash[key] = value if subtree
          else
            store_link(locale, key, value) if value.is_a?(Symbol)
            hash[key] = value
          end
        end