def flatten(translations, current_scope = nil)
      translations.each_with_object({}) do |(key, value), memo|
        scope = current_scope ? join(current_scope, key) : key.to_s
        if value.is_a?(Hash)
          memo.merge!(flatten(value, scope))
        else
          memo[scope] = value
        end
      end
    end
def flatten(translations, current_scope = nil)
      translations.each_with_object({}) do |(key, value), memo|
        scope = current_scope ? join(current_scope, key) : key.to_s
        if value.is_a?(Hash)
          memo.merge!(flatten(value, scope))
        else
          memo[scope] = value
        end
      end
    end
Recurrently flattens hash by converting its keys to fully scoped ones.

 @return [Hash{String => String}]
 @param translations [Hash{String/Symbol => String/Hash}] with multiple
   roots allowed
 @param current_scope for internal use

 @example
   Scope.flatten(en: {common: {hello: "hi"}}, de: {hello: "Hallo"}) #=>
     {"en.common.hello" => "hi", "de.hello" => "Hallo"}