ntzrbtr / deepl-translator
Command-line tool to translate language files using DeepL
v1.0.3
2023-01-19 07:41 UTC
Requires
- php: >=8.0.0
- deeplcom/deepl-php: ^1.2
- riimu/kit-phpencoder: ^2.4
- symfony/console: ^6.2
- symfony/dotenv: ^6.2
README
This is a simple command-line tool to translate files containing locale strings in the form of PHP array (as e.g. used by Laravel) using the DeepL API.
Installation
Install the package using composer: composer require --dev ntzrbtr/deepl-translate
.
Setup
- Create a DeepL API key at https://www.deepl.com/pro#developer
- Create a
.env
file in the root of your project and add the following line:DEEPL_API_KEY=your-api-key
Usage
- Run
vendor/bin/deepl-translate [options] <source> <target>
to translate your file<source>
is the source file<target>
is the target file- Within
[options]
you can set the source and target language:--source-language
(default:en
)--target-language
(default:de
)