Module: Crowdin::ApiResources::StringTranslations
- Defined in:
- lib/crowdin-api/api_resources/string_translations.rb
Instance Method Summary collapse
- #add_approval(query = {}, project_id = config.project_id) ⇒ Object
- #add_translation(query = {}, project_id = config.project_id) ⇒ Object
- #add_translation_alignment(project_id = nil, query = {}) ⇒ Object
- #add_vote(query = {}, project_id = config.project_id) ⇒ Object
- #cancel_vote(vote_id = nil, project_id = config.project_id) ⇒ Object
- #delete_string_translations(query = {}, project_id = config.project_id) ⇒ Object
- #delete_translation(translation_id = nil, project_id = config.project_id) ⇒ Object
- #get_approval(approval_id = nil, project_id = config.project_id) ⇒ Object
- #get_translation(translation_id = nil, query = {}, project_id = config.project_id) ⇒ Object
- #get_vote(vote_id = nil, project_id = config.project_id) ⇒ Object
- #list_language_translations(language_id = nil, query = {}, project_id = config.project_id) ⇒ Object
- #list_string_translations(query = {}, project_id = config.project_id) ⇒ Object
- #list_translation_approvals(query = {}, project_id = config.project_id) ⇒ Object
- #list_translation_votes(query = {}, project_id = config.project_id) ⇒ Object
- #remove_approval(approval_id = nil, project_id = config.project_id) ⇒ Object
- #remove_string_approvals(query = {}, project_id = config.project_id) ⇒ Object
- #restore_translation(translation_id = nil, project_id = config.project_id) ⇒ Object
Instance Method Details
#add_approval(query = {}, project_id = config.project_id) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 18 def add_approval(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :post, "#{config.target_api_url}/projects/#{project_id}/approvals", { params: query } ) Web::SendRequest.new(request).perform end |
#add_translation(query = {}, project_id = config.project_id) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 91 def add_translation(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :post, "#{config.target_api_url}/projects/#{project_id}/translations", { params: query } ) Web::SendRequest.new(request).perform end |
#add_translation_alignment(project_id = nil, query = {}) ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 200 def add_translation_alignment(project_id = nil, query = {}) project_id || raise_project_id_is_required_error %i[source_language_id target_language_id text].each do |param| query[param] || raise_parameter_is_required_error(param) end request = Web::Request.new( connection, :post, "#{config.target_api_url}/projects/#{project_id}/translations/alignment", { params: query } ) Web::SendRequest.new(request).perform end |
#add_vote(query = {}, project_id = config.project_id) ⇒ Object
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 164 def add_vote(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :post, "#{config.target_api_url}/projects/#{project_id}/votes", { params: query } ) Web::SendRequest.new(request).perform end |
#cancel_vote(vote_id = nil, project_id = config.project_id) ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 188 def cancel_vote(vote_id = nil, project_id = config.project_id) vote_id || raise_parameter_is_required_error(:vote_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/projects/#{project_id}/votes/#{vote_id}" ) Web::SendRequest.new(request).perform end |
#delete_string_translations(query = {}, project_id = config.project_id) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 103 def delete_string_translations(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/projects/#{project_id}/translations", { params: query } ) Web::SendRequest.new(request).perform end |
#delete_translation(translation_id = nil, project_id = config.project_id) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 140 def delete_translation(translation_id = nil, project_id = config.project_id) translation_id || raise_parameter_is_required_error(:translation_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/projects/#{project_id}/translations/#{translation_id}" ) Web::SendRequest.new(request).perform end |
#get_approval(approval_id = nil, project_id = config.project_id) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 30 def get_approval(approval_id = nil, project_id = config.project_id) approval_id || raise_parameter_is_required_error(:approval_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/approvals/#{approval_id}" ) Web::SendRequest.new(request).perform end |
#get_translation(translation_id = nil, query = {}, project_id = config.project_id) ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 115 def get_translation(translation_id = nil, query = {}, project_id = config.project_id) translation_id || raise_parameter_is_required_error(:translation_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/translations/#{translation_id}", { params: query } ) Web::SendRequest.new(request).perform end |
#get_vote(vote_id = nil, project_id = config.project_id) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 176 def get_vote(vote_id = nil, project_id = config.project_id) vote_id || raise_parameter_is_required_error(:vote_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/votes/#{vote_id}" ) Web::SendRequest.new(request).perform end |
#list_language_translations(language_id = nil, query = {}, project_id = config.project_id) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 66 def list_language_translations(language_id = nil, query = {}, project_id = config.project_id) language_id || raise_parameter_is_required_error(:language_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/languages/#{language_id}/translations", { params: query } ) Web::SendRequest.new(request).perform end |
#list_string_translations(query = {}, project_id = config.project_id) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 79 def list_string_translations(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/translations", { params: query } ) Web::SendRequest.new(request).perform end |
#list_translation_approvals(query = {}, project_id = config.project_id) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 6 def list_translation_approvals(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/approvals", { params: query } ) Web::SendRequest.new(request).perform end |
#list_translation_votes(query = {}, project_id = config.project_id) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 152 def list_translation_votes(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/projects/#{project_id}/votes", { params: query } ) Web::SendRequest.new(request).perform end |
#remove_approval(approval_id = nil, project_id = config.project_id) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 42 def remove_approval(approval_id = nil, project_id = config.project_id) approval_id || raise_parameter_is_required_error(:approval_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/projects/#{project_id}/approvals/#{approval_id}" ) Web::SendRequest.new(request).perform end |
#remove_string_approvals(query = {}, project_id = config.project_id) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 54 def remove_string_approvals(query = {}, project_id = config.project_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/projects/#{project_id}/approvals", { params: query } ) Web::SendRequest.new(request).perform end |
#restore_translation(translation_id = nil, project_id = config.project_id) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/crowdin-api/api_resources/string_translations.rb', line 128 def restore_translation(translation_id = nil, project_id = config.project_id) translation_id || raise_parameter_is_required_error(:translation_id) project_id || raise_project_id_is_required_error request = Web::Request.new( connection, :put, "#{config.target_api_url}/projects/#{project_id}/translations/#{translation_id}" ) Web::SendRequest.new(request).perform end |