Libretranslate
LibreTranslate provider for Strapi Translate Plugin
LibreTranslate provider for Strapi Translate Plugin
Configure the provider through the providerOptions:
1module.exports = {
2 // ...
3 translate: {
4 enabled: true,
5 config: {
6 // Choose one of the available providers
7 provider: 'libretranslate',
8 // Pass credentials and other options to the provider
9 providerOptions: {
10 // your API key - required and wil cause errors if not provided
11 apiKey: 'key',
12 // api url - required
13 apiUrl: 'https://your.libretranslate.instance',
14 // maximum number of requests per minute - optional, default is `undefined` => no limit
15 apiMaxRPM: 60,
16 // maximum number of chars per request - optional, default is `undefined` => no limit
17 apiMaxChars: 1234,
18 // maximum number of texts per request
19 apiMaxTexts: 55,
20 // manually overwrite the Strapi Locale to LibreTranslate Locale mapping.
21 // default is the string before the `-` character for every locale
22 localeMap: {
23 'en-US': 'de',
24 },
25 },
26 // other options ...
27 },
28 },
29 // ...
30}
or use the default environment variables:
LT_API_KEY
- defaultundefined
LT_API_URL
- defaultundefined
LT_API_MAX_RPM
- defaultundefined
LT_API_MAX_CHARS
- defaultundefined
LT_API_MAX_TEXTS
- defaultundefined
Note that environment variables take precedence over values providerOptions
. To force no limit on requests per second or maximum characters, set them to -1
Limitations:
- Only the languages supported by argos, the actual translation library behind LibreTranslate, can be translated.
- LibreTranslate servers can impose additional restrictions, such as limits to request frequency or size. You can configure those via the pluginOptions, by default there are no limitations, because LibreTranslate has no limitations by default
Install now
npm install strapi-provider-translate-libretranslate
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.