pashkinz92 / yii2-yandex-translate
Translate content using YandexTranslateAPI
Installs: 85
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/pashkinz92/yii2-yandex-translate
This package is auto-updated.
Last update: 2025-09-29 02:01:29 UTC
README
Translate content using YandexTranslateAPI
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pashkinz92/yii2-yandex-translate "*"
or add
"pashkinz92/yii2-yandex-translate": "*"
to the require section of your composer.json
file.
Usage
'components' => [
...
'translate' => [
'class' => \pashkinz92\yandex\translate\Translation::className(),
'key' => 'yandexTranslateApiKey',
],
...
]
Once the extension is installed, simply use it in your code by :
$lang = Yii::$app->translate->detect('Hello !');
echo '<pre>';
var_dump($lang);
echo '</pre>';