Method: Txgh::ResourceCommitter#commit_resource

Defined in:
lib/txgh/resource_committer.rb

#commit_resource(tx_resource, branch, language) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/txgh/resource_committer.rb', line 13

def commit_resource(tx_resource, branch, language)
  return if prevent_commit_on?(branch)

  unless language == tx_resource.source_lang
    file_name, translations = download(tx_resource, branch, language)
    message = commit_message_for(language, file_name)

    if translations
      repo.api.commit(repo.name, branch, { file_name => translations }, message)
      fire_event_for(tx_resource, branch, language)
    end
  end
end