def update_file(files, params = {})
      params[:files] = Hash[files.map { |f|
        dest = f[:dest] || raise(ArgumentError, "'`:dest` is required'")
        source = ::File.open(f[:source] || raise(ArgumentError, "'`:source` is required'"))
        source.define_singleton_method(:original_filename) do
          dest
        end
        [dest, source]
      }]

      params[:titles] = Hash[files.map { |f| [f[:dest], f[:title]] }]
      params[:titles].delete_if { |_, v| v.nil? }

      params[:export_patterns] = Hash[files.map { |f| [f[:dest], f[:export_pattern]] }]
      params[:export_patterns].delete_if { |_, v| v.nil? }

      params.delete_if { |_, v| v.respond_to?(:empty?) ? !!v.empty? : !v }

      request(
        :method => :post,
        :path   => "/api/project/#{@project_id}/update-file",
        :query  => params,
      )
    end
def update_file(files, params = {})
      params[:files] = Hash[files.map { |f|
        dest = f[:dest] || raise(ArgumentError, "'`:dest` is required'")
        source = ::File.open(f[:source] || raise(ArgumentError, "'`:source` is required'"))
        source.define_singleton_method(:original_filename) do
          dest
        end
        [dest, source]
      }]

      params[:titles] = Hash[files.map { |f| [f[:dest], f[:title]] }]
      params[:titles].delete_if { |_, v| v.nil? }

      params[:export_patterns] = Hash[files.map { |f| [f[:dest], f[:export_pattern]] }]
      params[:export_patterns].delete_if { |_, v| v.nil? }

      params.delete_if { |_, v| v.respond_to?(:empty?) ? !!v.empty? : !v }

      request(
        :method => :post,
        :path   => "/api/project/#{@project_id}/update-file",
        :query  => params,
      )
    end
Upload fresh version of your localization file to Crowdin.

 == Parameters

 files - Array of files that should be updated in Crowdin project.
 file is a Hash { :dest, :source }
 * :dest - file name with path in Crowdin project (required)
 * :source - path for uploaded file (required)
 * :title - title in Crowdin UI (optional)
 * :export_pattern - Resulted file name (optional)

 Optional:
 * :branch - a branch name

 == Request

 POST https://api.crowdin.com/api/project/{project-identifier}/update-file?key={project-key}