Deepl.Language (deepl v0.3.0)

View Source

Provides functions to get the list of supported languages.

API references for this module can be found in the Retrieve languages documentation.

Summary

Functions

Get the list of supported languages.

Functions

get_languages(opts \\ [])

(since 0.3.0)
@spec get_languages(Keyword.t()) :: {:ok, map()} | {:error, String.t()}

Get the list of supported languages.

Returns a list of supported languages, either source languages or target languages.

Options

The accepted options are:

  • :type - The type of languages to retrieve, either "source" or "target", defaults to "source".

Examples

iex> Deepl.Language.get_languages()
{:ok,
 [
   %{"language" => "AR", "name" => "Arabic"},
   %{"language" => "BG", "name" => "Bulgarian"}
 ]}

iex> Deepl.Language.get_languages(type: "target")
{:ok,
 [
   %{"language" => "AR", "name" => "Arabic", "supports_formality" => false},
   %{"language" => "BG", "name" => "Bulgarian", "supports_formality" => false}
 ]}