Git Product home page Git Product logo

deepl's Introduction

Laravel Deepl

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 Deepl

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.

deepl's People

Contributors

salmanbe avatar

Stargazers

 avatar Charlie Pearce avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.