Download the PHP package ejesus/laravel-auto-translator without Composer
On this page you can find all versions of the php package ejesus/laravel-auto-translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ejesus/laravel-auto-translator
More information about ejesus/laravel-auto-translator
Files in ejesus/laravel-auto-translator
Package laravel-auto-translator
Short Description A Laravel package that leverages the DeepL Translation API to automatically translate all your language files based on an existing translation, making multilingual projects faster and easier to manage.
License MIT
Informations about the package laravel-auto-translator
Laravel Auto Translator Package
A Laravel package that automatically translates content based on user input. This package allows users to specify a source language (--from
) and a target language (--to
), supporting multiple target languages by separating them with commas (e.g., pt,es
). The package uses Deepl API for translation, requiring an API key to work.
Installation
-
Install the package via Composer:
- Add the API key to your
.env
file: To use Deepl API, you need to obtain an API key from Deepl (https://www.deepl.com/pro) and set it in your.env
file.
Usage
You can use the package with the following Artisan command:
Parameters
--from
: The source language code (e.g.,en
for English,de
for German).--to
: The target language(s) for translation. You can specify multiple target languages by separating them with commas (e.g.,pt,es
for Portuguese and Spanish).
Example
To translate from English (en
) to Portuguese (pt
) and Spanish (es
):
This command will automatically translate your content from English to both Portuguese and Spanish using Deepl API.
Requirements
-
Deepl API Key: You need to create an account on Deepl and generate an API key. Place the key in your
.env
file under the variableTRANSLATE_API_KEY
. - Laravel 8 or higher.
Notes
- The translation will be done based on the API capabilities of Deepl. If Deepl API has any rate limits or issues, the translation process might be delayed.
- The
--from
and--to
languages should use standard ISO language codes (e.g.,en
,es
,de
, etc.). - If multiple target languages are provided, the content will be translated and saved for each target language specified.
License
This package is open source and available under the MIT License.
All versions of laravel-auto-translator with dependencies
laravel/framework Version ^11.31
guzzlehttp/guzzle Version ^7.9
nunomaduro/termwind Version ^2.3