Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support concordance and alignment API endpoints #40

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/crowdin-api/api_resources/glossaries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,22 @@ def delete_concept(glossary_id = nil, concept_id = nil)
)
Web::SendRequest.new(request).perform
end

def search_glossaries_concordance(project_id = nil, query = {})
project_id || raise_project_id_is_required_error

%i[source_language_id target_language_id expression].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}/glossaries/concordance",
{ params: query }
)
Web::SendRequest.new(request).perform
end
end
end
end
16 changes: 16 additions & 0 deletions lib/crowdin-api/api_resources/string_translations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ def cancel_vote(vote_id = nil, project_id = config.project_id)
)
Web::SendRequest.new(request).perform
end

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
end
end
end
16 changes: 16 additions & 0 deletions lib/crowdin-api/api_resources/translation_memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ def check_tm_import_status(tm_id = nil, import_id = nil)
)
Web::SendRequest.new(request).perform
end

def search_tms_concordance(project_id = nil, query = {})
project_id || raise_project_id_is_required_error

%i[source_language_id target_language_id expression auto_substitution min_relevant].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}/tms/concordance",
{ params: query }
)
Web::SendRequest.new(request).perform
end
end
end
end
Loading