npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-google-translator

v1.0.8

Published

Easily translate your Strapi content into 100+ languages.

Downloads

382

Readme

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.

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