bedita / i18n-aws
BEdita I18n Aws 插件支持 PHP >= 7.4
v0.0.4
2024-04-17 11:46 UTC
Requires
- php: >=7.4
- aws/aws-sdk-php: ^3.285
- bedita/i18n: ^4.4.3
- cakephp/utility: ^4.4
Requires (Dev)
- cakephp/cakephp: ^4.4
- cakephp/cakephp-codesniffer: ~4.7.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.3
README
安装
您可以使用 composer 将此插件安装到您的应用程序中。
安装 composer 包的推荐方式是
composer require bedita/i18n-aws
注意:支持的 php 版本是 >= 7.4。
Amazon Translate
此插件使用 AWS Translate 通过 aws-sdk-php 来翻译文本。
使用示例
use BEdita\I18n\Aws\Core\Translator; $translator = new Translator(); $translator->setup([ 'profile' => 'your-profile', // the AWS profile 'region' => 'your-region', // the AWS region ]); $result = $translator->translate(['Hello world!'], 'en', 'it'); // $result is an array, i.e ['translation' => ['Ciao mondo!']]