Configure the provider through the pluginOptions:
module.exports = {
// ...
translate: {
enabled: true,
config: {
// Choose one of the available providers
provider: 'deepl',
// Pass credentials and other options to the provider
providerOptions: {
// your API key - required and wil cause errors if not provided
apiKey: 'key',
// use custom api url - optional
apiUrl: 'https://api-free.deepl.com',
// use custom locale mapping (for example 'en' locale is deprecated so need to choose between 'EN-GB' and 'EN-US')
localeMap: {
// use uppercase here!
EN: 'EN-US',
},
apiOptions: {
// see <https://github.com/DeepLcom/deepl-node#text-translation-options> for supported options.
// note that tagHandling Mode cannot be set this way.
// use with caution, as non-default values may break translation of markdown
formality: 'default',
// ...
},
},
// other options ...
},
},
// ...
}
or use the default environment variables:
DEEPL_API_KEY
- defaultundefined
DEEPL_API_URL
- defaultundefined
To get an API key, register for free at www.deepl.com/pro#developer.
- Only the deepl supported languages can be translated
- The API-Limits of DeepL (size, number of fields) and too many requests should be respected. If one field is larger than the request size limit, the content needs to be split and merged at some character, which may break the content layout!