webazon/yandex-translator
最新稳定版本:2.0.1
Composer 安装命令:
composer require webazon/yandex-translator
包简介
The unofficial PHP API library of Yandex.Translate. Version 2.
README 文档
README
Неофициальная API PHP библиотека Яндекс.Переводчика. Версия 2.
Для начала реализации необходимо настроить сервисный аккаунт на Яндекс.Облаке, определить ID каталога и получить сервисный API-ключ.
Установка
Можно установить используя менеджер пакетов Composer
$ composer require webazon/yandex-translator
или скачать пакет с GitHub
Инициализация и использование
require __DIR__ . '/vendor/autoload.php'; $translator = new Translator(["folder_id"=> "<ID каталога>", "ApiKey"=>'<API-ключ>']); $translate = $translator->Translate('Hello, World','en-ru'); $text = $translate -> text;
Список поддерживаемых языков можно получить командой:
$translate = $translator->listLanguages();
или в файле JSON в корне проекта.
Unofficial PHP API library Yandex.Translate. Version 2.
To start the implementation, you need to set up a service account on Yandex.Cloud, determine the folder ID and get the service API key.
Installation
Can be installed using the package manager Composer
$ composer require webazon/yandex-translator
or download the package from GitHub
Initialization and usage
require __DIR__ . '/vendor/autoload.php'; $translator = new Translator(["folder_id"=> "<Catalog ID>", "ApiKey"=>'<API-key>']); $translate = $translator->Translate('Hello, World','en-ru'); $text = $translate -> text;
The list of supported languages can be obtained using the command:
$translate = $translator->listLanguages();
or in the file JSON at the root of the project.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-19