strapi-provider-translate-google
v0.0.3
Published
Custom Strapi Provider Plugin For Translation With Google API
Downloads
20
Maintainers
Readme
Strapi Provider Translate Google
Welcome to the Strapi Provider Translate Google repository!
Table of Contents
Installing
Using npm:
$ npm install strapi-provider-translate-google
Using yarn:
$ yarn add strapi-provider-translate-google
Using pnpm:
$ pnpm add strapi-provider-translate-google
Usage
Configure the provider through the pluginOptions:
module.exports = {
// ...
translate: {
enabled: true,
config: {
// Choose google as the provider
provider: "google",
// Pass credentials and other options to the provider
providerOptions: {
// Your API key - required and wil cause errors if not provided
apiKey: "key",
// Your project id - required and wil cause errors if not provided
projectId: "project-id",
// Use custom locale mapping (for example to translate from your default locale to en-US)
localeMap: {
// Use uppercase here!
EN: "EN-US",
},
},
// Other options ...
},
},
// ...
};
or use the default environment variables:
GOOGLE_API_KEY
- defaultundefined
GOOGLE_PROJECT_ID
- defaultundefined
To get the API key and project id, follow the instructions in the Google Cloud Translation API documentation.
License
This repository is licensed under the MIT License. You are free to use, modify, and distribute the scripts as long as you include the original license text.