DeepL
DeepL provides industry-leading machine translation with excellent quality for European languages. The free tier includes 500,000 characters per month.
Setup
To use DeepL as your translation provider, add your API key to the global configuration:
return [
'johannschopplich.content-translator' => [
'DeepL' => [
'apiKey' => env('DEEPL_API_KEY')
]
]
];
Request Options
DeepL offers a variety of options to customize the text translation API endpoint. To learn more about the available options, please refer to the DeepL translate text parameters.
To set custom request options for the DeepL API, add them to the plugin's requestOptions configuration:
return [
'johannschopplich.content-translator' => [
'DeepL' => [
// All available options can be found in the DeepL API documentation:
// https://developers.deepl.com/docs/api-reference/translate#request-body-descriptions
'requestOptions' => [
// Lean towards formal language
'formality' => 'more'
]
]
]
];
Supported Languages
DeepL supports the following languages for translation:
Source Languages
Arabic (AR), Bulgarian (BG), Chinese (ZH), Czech (CS), Danish (DA), Dutch (NL), English (EN), Estonian (ET), Finnish (FI), French (FR), German (DE), Greek (EL), Hebrew (HE), Hungarian (HU), Indonesian (ID), Italian (IT), Japanese (JA), Korean (KO), Latvian (LV), Lithuanian (LT), Norwegian Bokmål (NB), Polish (PL), Portuguese (PT), Romanian (RO), Russian (RU), Slovak (SK), Slovenian (SL), Spanish (ES), Swedish (SV), Thai (TH), Turkish (TR), Ukrainian (UK), Vietnamese (VI)
Target Languages
All source languages plus regional variants:
- English: British (EN-GB), American (EN-US)
- Portuguese: Brazilian (PT-BR), European (PT-PT)
- Spanish: Latin American (ES-419)
- Chinese: Simplified (ZH-HANS), Traditional (ZH-HANT)
LC_ALL locale setting. For example, if your locale is en_GB, DeepL will receive EN-GB as the target language.