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

[Feature]: add support to use options on translate call and error handling #26

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

mbenatti
Copy link
Contributor

Description

Adds support to use options on translate calls and error handling

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Examples

iex> DeeplEx.translate("Hello man, how are you??", :EN, :PT_BR, %{formality: "less"})
{:ok, "Olá, cara, como você está?"}
iex> DeeplEx.translate("Hello man, how are you??", :EN, :PT_BR, %{formality: "more"})
{:ok, "Olá, senhor, como o senhor está?"}
iex> DeeplEx.translate("Hello man, how are you??", :EN, :PT_BR, %{formality: "invalid"})
{:error, "Invalid request: Value for 'formality' not supported."}

@mbenatti mbenatti changed the title feature: add support to use options on translate call and error handling [Feature]: add support to use options on translate call and error handling Jan 29, 2024
Copy link
Member

@dustessavdh dustessavdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the pr!

@dustessavdh dustessavdh merged commit c5a1cc1 into hergetto:development Jan 30, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants