stajor/yandex-translate

PHP Yandex Translate API

1.0.0 2019-05-17 06:20 UTC

This package is auto-updated.

Last update: 2024-04-18 05:19:29 UTC


README

Minimal PHP version

PHP library for Yandex Translate API.

Installation

Via Composer:

composer require stajor/yandex-translate

Usage

Getting a list of supported languages

<?php

$translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN');
$response = $translateClient->getLangs('en');

Language detection

<?php

$translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN');
$response = $translateClient->detect('Hello world!');

Text translation

<?php

$translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN');
$response = $translateClient->translate('Hello world!', 'ru');

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Stajor/yandex-translate. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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