Strapi plugin logo for Strapi Google Translator

Strapi Google Translator

Easily translate your Strapi content into 100+ languages. With one-click, this free plugin translates your Strapi collections into 100+ languages using Google Cloud Translate.

thumbnail for Strapi Google Translator
stripe payment title

Strapi Translator

Easily translate your Strapi content into 100+ languages.

With one-click, this free plugin translates your Strapi collections into 100+ languages using Google Cloud Translate. It supports multiple translation strategies including Text, HTML, String and Skip. In addition, you can specify Glossaries, such as brand name, that should not get translated.


GitHub package.json version Monthly download on NPM synk


Translator-gif



Google Cloud Translate

Google Cloud Translate makes your content multilingual with fast, dynamic machine translation.

Why should you bother translating your content? Well, there are several reasons for you to translate your content:

  1. Reach global markets through internationalization of your products
  2. Engage your audience with compelling localization of your content
  3. Deliver seamless user experience with real-time translation

Google Cloud Translate Benefits

  • Unparalleled language support: Use machine translation to detect more than one hundred languages, from Afrikaans to Zulu. Build custom models in more than fifty language pairs using our no-code AutoML technology.
  • Best-in-class quality: Google has a rich history of providing translation services to consumers and organizations. Our proven models and tools bring Google’s translation expertise with industry-leading accuracy.
  • Domain specificity: Customize our translation services to understand industry slang, or domain-specific terms. Maintain the context and meaning in translations of technical documents, product descriptions, and social content.

Strapi is the leading open-source headless Content Management System. It’s 100% JavaScript, fully customizable and developer-first.

Overview: Easily translate your content

Translator plugin enables you to translate your Strapi content into 100+ languages.

Setting up the plugin is super easy and can be completed within 10 minutes.

  1. Enter your enviornment variables in .env file.
  2. Add the list of languages, that you want to translate into, in Strapi Settings.
  3. Enable localization for the content type that you want to translate.
  4. Go to Content Manager, select the collection type that you want to translate, select the languages and click on translate.



✨ Features

  1. Quick installation and setup.
  2. Easily translate your content to 100+ languages.
  3. Confugurable translation strategy schema for each field of a given content type.

Translation Strategies

Following are the supported translation strategies:

  1. String: translated as simple string, Glossary should work
  2. Text: translated as simple string, Glossary should work
  3. HTML: should be transformed to html first, translated and then converted back to markdown. Glossary should work.
  4. Skip: should be skipped for translation, but still moved as is; It could be used for field types such as image and file



🖐 Requirements

The requirements to install the Translator plugin is the same as those to install Strapi.

Please refer to the official Strapi installation requirement doc here: Installation Requirements.

Minimum environment requirements

  • Node.js >=14.x.x <=18.x.x
  • NPM >=6.x.x

We are following the official Node.js releases timelines.

Supported Strapi versions:

  • Strapi V4.4.5 (recently tested)

The Translator plugin is designed for Strapi v4.x. It won't work with Strapi v3.x.



⏳ Installation

Use npm to install this plugin within your Strapi project.

Refer to this doc to install npm

npm i strapi

After successful installation please add the below enviornment variables in .env files

STRAPI_BACKEND_URL=http://localhost:1337
STRAPI_GOOGLE_TRANSLATE_API_TOKEN=your strapi api token
GOOGLE_TRANSLATE_JSON={"type":"service_account","project_id":"your project_id","private_key_id":"your private key id","private_key":"-----BEGIN PRIVATE KEY-----\your private key\n-----END PRIVATE KEY-----\n","client_email": "your client email","client_id": "your client id","auth_uri": "your auth uri","token_uri": "your token uri","auth_provider_x509_cert_url": "your provider secret","client_x509_cert_url": "your client"}

Please make sure to add your Google Service Account JSON in a single sentence as shown above.

Also to create Strapi api token, Go to Settingd > API Tokens > Create new Api Tokens > Enter API name, Select Token duration Unlimited , Select Token type Full Access > Save > Copy the API Token and Add in your .env file.

After adding enviornment variables .env files, goto Config > plugins.js > Add the following code snippet.

1
2
3
4
5
6
7
8
9
10
11
module.exports = ({ env }) => ({

  "strapi-google-translator": {
    enabled: true,
    config: {
      backendUrl: env("STRAPI_BACKEND_URL"),
      apiToken: env("STRAPI_GOOGLE_TRANSLATE_API_TOKEN"),
      googleJson: env("GOOGLE_TRANSLATE_JSON"),
    },
  },
});

Afterwards, you would need to build a fresh package that includes the Translator plugin. For it, please execute the commands below:

# with npm (option 1)
$ npm run build
$ npm run develop

# with npx (option 2)
$ npx strapi  build
$ npx strapi  develop

The Translator plugin should appear in the Plugins section of the Strapi sidebar after you run the app again.



🔧 Configuration

You can easily configure the Stripe Translator plugin.

  • Go to setting -> Translator -> Configuration.
  • On the configuration page, you can select translation strategy for each field.
  • Click on Save to save the Translator confiiguration.

📝 License

MIT License

Copyright © 2021 AsyncWeb Technology

Install now

npm install strapi-google-translator

Last updated

15 days ago

Strapi Compatibility

>=4.0.0

Author

github profile image for AsyncWeb Technology
AsyncWeb Technology

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.