Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/salmanbe/deepl
Laravel library to import translations from Deepl Api
https://github.com/salmanbe/deepl
deepl laravel php translation
Last synced: 6 days ago
JSON representation
Laravel library to import translations from Deepl Api
- Host: GitHub
- URL: https://github.com/salmanbe/deepl
- Owner: salmanbe
- License: other
- Created: 2023-08-13T02:51:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-16T13:42:14.000Z (over 1 year ago)
- Last Synced: 2024-12-13T02:30:19.063Z (25 days ago)
- Topics: deepl, laravel, php, translation
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Deepl
====
This is an easy to use laravel library to import translations from Deepl Api. You must go to [www.deepl.com](https://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 Deepl](https://img.youtube.com/vi/ljoFvgCS2og/0.jpg)](https://www.youtube.com/watch?v=ljoFvgCS2og)Laravel Installation
-------
Install using composer:```bash
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`:
```php
Salmanbe\Deepl\DeeplServiceProvider::class,
```
You can also add it as a Facade in `config/app.php`:
```php
'Deepl' => Salmanbe\Deepl\Deepl::class,
```
Add 2 lines to config/app.php
```php
'deepl_url' => env('DEEPL_URL', ''),
'deepl_key' => env('DEEPL_KEY', ''),
```Add 2 lines to .env
```php
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.
```php
$deepl = new Deepl();
```
Set text, target and source language. source language is optional.
```php
$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](https://github.com/salmanbe/deepl/blob/master/LICENSE) for more information.
## Security contact information
To report a security vulnerability, follow [these steps](https://tidelift.com/security).