Strapi plugin logo for Libretranslate

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 - default undefined
  • LT_API_URL - default undefined
  • LT_API_MAX_RPM - default undefined
  • LT_API_MAX_CHARS - default undefined
  • LT_API_MAX_TEXTS - default undefined

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:

Install now

npm install strapi-provider-translate-libretranslate

STATS

70 GitHub stars19 weekly downloads

Last updated

25 days ago

Strapi Version

Unavailable

Author

github profile image for Yannick Lang
Yannick Lang

Related plugin

Translate

Useful links

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.