2019-06-30 23:31:34 +03:00
2019-06-30 10:12:38 +03:00
2020-06-16 20:20:49 +03:00
2019-06-30 09:19:38 +03:00
2019-06-26 00:01:10 +03:00
2019-06-17 23:52:08 +03:00
2020-06-16 20:20:49 +03:00
2020-06-16 20:20:49 +03:00
2020-04-11 04:38:03 +03:00

YandexTranslate

A simple Elixir interface to Cloud Yandex Translate's translation API

Installation

If available in Hex, the package can be installed by adding yandex_translate to your list of dependencies in mix.exs:

def deps do
  [
    {:yandex_translate, "~> 0.1.0"}
  ]
end

Get access to API

Creating a Service Account in the Yandex.Cloud

To perform operations in Yandex.Cloud via the API, you need to create Service Account for Yandex Account. For security reasons this library doesn't support Yandex Account directly. After creating a service account, you have two options: use s or use IAM Tokens. To perform operations in Yandex.Cloud via the API, you need API key or IAM token.

Getting a API_KEY

Create API key for a service account.

config :yandex_translate,
  api_key: "API_KEY"

Getting a IAM Token (from 0.2.0)

Get an IAM token for a service account. In config/config.exs, add:

config :yandex_translate,
  service_account_id: "SERVICE_ACCOUNT_ID",
  authorized_key_id: "AUTHORIZED_KEY_ID",
  private_key: "PRIVATE_KEY"

Usage

Supported languages

Request for getting list of supported languages is #languages.

  YandexTranslate.languages()

Language detection

Request for detecting language of text is #detect.

  YandexTranslate.detect("Hello")

Translation

Request for translating text is #translate.

  YandexTranslate.translate("Hello", "uk")

Contributing

Bug reports and pull requests are welcome on at https://gl.negrienko.com/negrienko/yandex_translate.

License

The hex is available as open source under the terms of the MIT License.

Disclaimer

Use this package at your own peril and risk.

Documentation

Documentation generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/yandex_translate.

Description
Translate word and phrases using the Yandex Translate API.
Readme 57 KiB
Languages
Elixir 100%