
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
sanity-plugin-google-translate-aadgrant
Advanced tools
Translate your content with Google Translate directly from your Sanity Studio!
This plugin lets you connect Sanity fields to Google Cloud Translate API, giving you instant machine translations for 108 languages and counting! Enable it for all of them! ...or just the ones you need.
https://user-images.githubusercontent.com/9684022/158199868-5426b7dd-8439-406f-bf16-661c4bf060a0.mov
sanity install google-translate
The Google Translate plugin is designed to work with field-level translated objects as a Custom Input Component to add a superset of features – automated machine translation.
These objects should be registered in the way recommended by the @sanity/language-filter plugin.
Adding the Translation buttons requires adding an inputComponent and API key to the object's schema. See this example of a localized string object below.
Note: This will not translate Portable Text content, as that schema type should not be mapped over multiple times in a single document. If you need multiple languages of Portable Text, you are best to use document-level translation.
string objectsimport GoogleTranslateInput from 'sanity-plugin-google-translate'
const languages = [
{id: 'en', title: 'English', isDefault: true},
{id: 'es', title: 'Spanish'},
{id: 'fr', title: 'French'},
]
export default {
name: 'localizedString',
type: 'object',
// 👇 👇 👇
// See: https://www.sanity.io/docs/custom-input-widgets
inputComponent: GoogleTranslateInput,
options: {
// This API key will be bundled with your studio
// and so should be restricted by hostname
// See: https://www.sanity.io/docs/studio-environment-variables
apiKey: process.env.SANITY_STUDIO_GOOGLE_TRANSLATE_API_KEY,
},
// 👆 👆 👆
fieldsets: [
{
title: 'Translations',
name: 'translations',
options: {collapsible: true, collapsed: false},
},
],
fields: languages.map((lang) => ({
name: lang.id,
title: lang.title,
type: 'string', // or `text`, etc
fieldset: lang.isDefault ? null : 'translations',
})),
}
string objects with Google TranslateAlternatively, you could selectively extend specific uses of localizedString, by registering another object to your schema which uses it as a base. This is helpful if you only need Google Translate on specific fields.
import GoogleTranslateInput from 'sanity-plugin-google-translate'
export default {
name: 'localizedGoogleTranslateString',
title: 'Localized String',
type: 'localizedString',
inputComponent: GoogleTranslateInput,
options: {
apiKey: process.env.SANITY_STUDIO_GOOGLE_TRANSLATE_API_KEY,
},
}
By including your Google Cloud Translation API key in the schema definition it becomes part of the Studio bundle which is hosted as static files on webservers.
To avoid others using your key you should restrict it to hosts where your studio runs, like
http://localhost:3333/*http://<your-project>.sanity.studio/*FAQs
Translate your content with Google Translate directly from your Sanity Studio!
We found that sanity-plugin-google-translate-aadgrant demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.