worksome/translator
最新稳定版本:v0.3.2
Composer 安装命令:
composer require worksome/translator
包简介
A driver-based translation package for Laravel
README 文档
README
A driver-based translation package for Laravel.
Installation
You can install the package via composer:
composer require worksome/translator
You can publish the config file with:
php artisan vendor:publish --tag="translator-config"
Usage
$translator = new \Worksome\Translator\TranslationManager(); $translator->driver('google_cloud_translate')->translate('Text to translate', 'en', 'da'); // TranslationDTO $translator->driver('google_cloud_translate')->detectLanguage('Text to detect'); // DetectedLanguageDTO
Via the Facade
// Use the default driver \Worksome\Translator\Facades\Translator::translate(''); // Use a custom driver \Worksome\Translator\Facades\Translator::driver('google_cloud_translate')->translate('', 'en', 'da');
Test suites can utilise the null driver, this will always return the same string value as provided for translations.
Testing
composer test
Changelog
Please see GitHub Releases for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 422.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-20