Introduction

Overview of the General Translation Sanity CMS plugin

Overview

The gt-sanity plugin integrates General Translation directly into Sanity Studio v3+. It provides a complete translation workflow for your Sanity content, including auto-translation, document-level translation, and translated document management.

sanity.config.ts
import { gtPlugin } from 'gt-sanity';

export default defineConfig({
  plugins: [
    gtPlugin({
      sourceLocale: 'en',
      locales: ['es', 'zh', 'ja'],
    }),
  ],
});

Key Features

Document Translation

Translate entire documents to multiple target locales. The plugin handles Portable Text, nested objects, arrays, and custom schema types.

Batch Operations

Translate multiple documents or your entire site all at once. Import all translations, import only missing translations, or selectively import by locale.

Intelligent Serialization

Documents are serialized to HTML for translation, preserving structure and metadata. Translations for languages with different grammatical structures have their structures' automatically modified to sound natural in the target language.

Custom serializers let you control how specific field types are handled.

Plugin UI

The plugin provides two main UI components:

Translations Tab

TranslationsTab

The Translations Tab is a Sanity view component that provides a document-level view of the translations for a document. It is used to translate the entire document as a unit.

Translations Page

TranslationsPage

The Translations Page is a Sanity page that provides a site-wide view of the translations for your entire site. From this central management page, you can:

  • Bulk generate translations for all documents
  • Bulk import translations for all documents
  • Bulk import translations for specific documents
  • Repair language references and links to other documents
  • Bulk publish translations for every document

Supported Content Types

The plugin handles most Sanity schema types.

Custom types can be configured with custom serializers.

Next Steps

How is this guide?