salmanbe/deepl
Composer 安装命令:
composer require salmanbe/deepl
包简介
Laravel library to import translations from Deepl Api
关键字:
README 文档
README
This is an easy to use laravel library to import translations from Deepl Api. You must go to www.deepl.com to register and acquire an API key to use with this library. Please note that neither this laravel library is made on behalf of deepl nor developer is acting on behalf of deepl. There is no corporation between Deepl and this library. Deepl is not responsible for this library. Deepl API credit goes to deepl.
Video Tutorial
Laravel Installation
Install using composer:
composer require salmanbe/deepl
There is a service provider included for integration with the Laravel framework. This service should automatically be registered else to register the service provider, add the following to the providers array in config/app.php:
Salmanbe\Deepl\DeeplServiceProvider::class,
You can also add it as a Facade in config/app.php:
'Deepl' => Salmanbe\Deepl\Deepl::class,
Add 2 lines to config/app.php
'deepl_url' => env('DEEPL_URL', ''), 'deepl_key' => env('DEEPL_KEY', ''),
Add 2 lines to .env
DEEPL_URL=https://api-free.deepl.com/v2/translate // https://api.deepl.com/v2/translate for pro DEEPL_KEY=your_deepl_api_key // Get api key from www.deepl.com
Basic Usage
Add use Salmanbe\Deepl\Deepl; or use Deepl; at top of the class where you want to use it. Then create class instance.
$deepl = new Deepl();
Set text, target and source language. source language is optional.
$deepl->get($text, $target_lang, $source_lang); $deepl->get('Welcome', 'fr', 'en');
Uninstall
First remove Salmanbe\Deepl\DeeplServiceProvider::class, and
'Deepl' => Salmanbe\Deepl\Deepl::class, from config/app.php if it was added.
Then Run composer remove salmanbe/deepl
License
This library is licensed under THE MIT License. Please see License File for more information.
Security contact information
To report a security vulnerability, follow these steps.
salmanbe/deepl 适用场景与选型建议
salmanbe/deepl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 63 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 08 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「translation」 「translate」 「deepl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 salmanbe/deepl 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 salmanbe/deepl 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 salmanbe/deepl 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use i18n translation PHP class for multi-language websites
Store your language lines in the database, yaml or other sources
A custom URL rule class for Yii 2 which allows to create translated URL rules
DeepL API client wrapper for Laravel
A Laravel Eloquent model trait for translatable resource
An Astrotomic Translatable extension for Laravel Nova.
统计信息
- 总下载量: 63
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-13