Socket
Book a DemoInstallSign in
Socket

strapi-provider-translate-googleapi

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-provider-translate-googleapi

Cloud Translate API Google integration for Strapi 4

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
6
-64.71%
Maintainers
1
Weekly downloads
 
Created
Source

Cloud Translate API provider for Strapi Translate Plugin

💻 Prerequisites

Before you begin, make sure you've met the following requirements:

  • Strapi 4 (last tested version: 4.24.2)
  • Install plugin Strapi Plugin Translate
  • Enable Cloud Translation API on Google Cloud Console. (API & Services)
  • Generate Google service account

🚀 Installation

npm install strapi-provider-translate-googleapi

or:

yarn add strapi-provider-translate-googleapi

☕ Configuration

  • Set env variables on Strapi .env
STRAPI_GOOGLE_PROJECT_ID=
STRAPI_GOOGLE_PRIVATE_KEY_ID=
STRAPI_GOOGLE_PRIVATE_KEY=
STRAPI_GOOGLE_CLIENT_EMAIL=
STRAPI_GOOGLE_CLIENT_ID=
STRAPI_GOOGLE_CLIENT_X509_CERT_URL=,

Javascript:

  • Path: config/plugins.[t|j]s
module.exports = {
  //...
  translate: {
    enabled: true,
    config: {
      provider: "google",
      providerOptions: {
        project_id: env("STRAPI_GOOGLE_PROJECT_ID"),
        private_key_id: env("STRAPI_GOOGLE_PRIVATE_KEY_ID"),
        private_key: env("STRAPI_GOOGLE_PRIVATE_KEY"),
        client_email: env("STRAPI_GOOGLE_CLIENT_EMAIL"),
        client_id: env("STRAPI_GOOGLE_CLIENT_ID"),
        client_x509_cert_url: env("STRAPI_GOOGLE_CLIENT_X509_CERT_URL"),
        apiOptions: {
          //Cloud Translate API options ...
        },
      },
      translatedFieldTypes: [
        "string",
        { type: "text", format: "plain" },
        // Change format to markdown if default richtext field on Strapi
        { type: "richtext", format: "html" },
        "component",
        "dynamiczone",
      ],
      translateRelations: true,
    },
  },
  //...
};
  • Run commands
 npm run build && npm run develop

📝 Licença

This project is under license. See the LICENSE file for more details.

Keywords

strapi

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.