translate-laravel/config/translate.php
Leonid Nikitin 7e05777385
Add LogDriver for translation with configuration support.
Introduced a new LogDriver for logging translation operations. Updated the README and configuration file to include support for the LogDriver and its associated limits. This feature enables the use of a logging-based translation driver for testing and debugging purposes.
2024-12-10 21:54:11 +05:00

51 lines
1.9 KiB
PHP

<?php declare(strict_types=1);
/**
* Copyright (c) 2024
* author: Leonid Nikitin - i@kor-elf.net
* web: https://git.kor-elf.net/kor-elf
* Initial version created on: 15.09.2024
* MIT license: https://git.kor-elf.net/kor-elf/translate-laravel/src/branch/main/LICENSE
*/
return [
/*
|--------------------------------------------------------------------------
| Default Translate Service
|--------------------------------------------------------------------------
|
| This option controls the default translate service that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a translation operation inside the application.
|
*/
'default' => env('TRANSLATE_SERVICE', 'yandex'),
'services' => [
'yandex' => [
'driver' => '\KorElf\TranslateLaravel\Translate\YandexDriver',
'config' => [
'folder_id' => env('TRANSLATE_YANDEX_FOLDER_ID'),
'authorized_key_path' => base_path(env('TRANSLATE_YANDEX_AUTHORIZED_KEY_PATH')),
'limit' => [
'max_request' => (int) env('TRANSLATE_YANDEX_LIMIT_MAX_REQUEST', 20),
'rate_seconds' => (int) env('TRANSLATE_YANDEX_LIMIT_RATE_SECONDS', 1),
'max_symbols' => (int) env('TRANSLATE_YANDEX_LIMIT_MAX_SYMBOLS', 9000),
],
],
],
'log' => [
'driver' => '\KorElf\TranslateLaravel\Translate\LogDriver',
'config' => [
'limit' => [
'max_request' => (int) env('TRANSLATE_LOG_LIMIT_MAX_REQUEST', 20),
'rate_seconds' => (int) env('TRANSLATE_LOG_LIMIT_RATE_SECONDS', 1),
'max_symbols' => (int) env('TRANSLATE_LOG_LIMIT_MAX_SYMBOLS', 9000),
],
],
],
],
];