Skip to content

Fork of DeepL provider (strapi-provider-translate-deepl) for translate plugin in Strapi 4 with Jsonb support

License

Notifications You must be signed in to change notification settings

boardmain/strapi-provider-translate-deepljsonb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepL provider for Strapi Translate Plugin

with this strapi translate plugin , you can translate all blocks JSONB paragraph text.

add { type: 'blocks', format: 'markdown' }, in the translate plugin transaltedFieldTypes as follow

translatedFieldTypes: [ 'string', { type: 'text', format: 'plain' }, { type: 'blocks', format: 'markdown' }, { type: 'richtext', format: 'markdown' }, 'component', 'dynamiczone', ],

Configure the provider through the pluginOptions:

module.exports = {
  // ...
  translate: {
    enabled: true,
    config: {
      // Choose one of the available providers
      provider: 'deepljsonb',
      // 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 - default undefined
  • DEEPL_API_URL - default undefined

To get an API key, register for free at www.deepl.com/pro#developer.

Limitations

About

Fork of DeepL provider (strapi-provider-translate-deepl) for translate plugin in Strapi 4 with Jsonb support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published