def save(translations, file)
      file = ::Rails.root.join(file)
      FileUtils.mkdir_p File.dirname(file)

      variable_to_assign = config.fetch(:variable, 'Ember.I18n.translations')

      File.open(file, 'w+') do |f|
        f << variable_to_assign
        f << ' = '
        f << JSON.pretty_generate(translations).html_safe
        f << ';'
      end
    end
def save(translations, file)
      file = ::Rails.root.join(file)
      FileUtils.mkdir_p File.dirname(file)

      variable_to_assign = config.fetch(:variable, 'Ember.I18n.translations')

      File.open(file, 'w+') do |f|
        f << variable_to_assign
        f << ' = '
        f << JSON.pretty_generate(translations).html_safe
        f << ';'
      end
    end
Convert translations to JSON string and save file.