# sanity-translations-tab

> This is the base module for implementing common translation vendor tasks from a Studio, such as sending content to be translated in some specific languages, importing content back etc. Not useful on its own, but vendor-specific plugins will use this for i

Latest version **6.1.21** (published 2026-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install sanity-translations-tab
pnpm add sanity-translations-tab
yarn add sanity-translations-tab
bun add sanity-translations-tab
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.1.21 |
| Published | 2026-08-21 |
| First published | 2021-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20.19 <22 \|\| >=22.12 |
| Dependencies | 6 |
| Unpacked size | 163.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 20 |
| Author | Sanity.io <hello@sanity.io> |
| Maintainers | rbotten, stipsan, sanity-svc.npm, cngonzalez-sanity, sanity-io |
| Keywords | sanity, sanity-plugin |

## Links

- npm: https://www.npmjs.com/package/sanity-translations-tab
- Repository: https://github.com/sanity-io/plugins
- Homepage: https://github.com/sanity-io/plugins/tree/main/plugins/sanity-translations-tab#readme
- Issues: https://github.com/sanity-io/plugins/issues
- npm.io page: https://npm.io/package/sanity-translations-tab

## Dependencies (6)

- [@sanity/ui](https://npm.io/package/@sanity/ui.md) ^4.0.4
- [@sanity/util](https://npm.io/package/@sanity/util.md) ^6.10.1
- [@sanity/icons](https://npm.io/package/@sanity/icons.md) ^5.2.1
- [@portabletext/to-html](https://npm.io/package/@portabletext/to-html.md) ^5.0.3
- [@portabletext/block-tools](https://npm.io/package/@portabletext/block-tools.md) ^5.2.0
- [sanity-naive-html-serializer](https://npm.io/package/sanity-naive-html-serializer.md) ^5.1.14

## Recent versions

- 6.1.21 (latest) — 2026-08-21
- 4.3.0-beta.6 (beta-merge-doc) — 2024-05-03
- 4.3.0-beta.3 (i18n-array) — 2024-03-20
- 4.3.0-beta.1 (callback-beta) — 2023-10-24
- 4.1.1-beta (beta) — 2023-10-23
- 4.2.0-beta.6 (i18n-array-beta) — 2023-09-28
- 2.0.11-beta.1 (studio-v2-beta) — 2023-04-14
- 2.0.10 (studio-v2) — 2023-03-29
- 6.1.20 — 2026-08-20
- 6.1.19 — 2026-08-11
- 6.1.18 — 2026-08-10
- 6.1.17 — 2026-07-23
- 6.1.16 — 2026-07-22
- 6.1.15 — 2026-07-17
- 6.1.14 — 2026-07-16
- … 74 more at https://npm.io/package/sanity-translations-tab/versions

## README

# sanity-translations-tab

This is the base module for implementing common translation vendor tasks from a Studio, such as sending content to be translated in some specific languages, importing content back etc. Not useful on its own, but vendor-specific plugins will use this for its chrome.

## Installation

```sh
npm install sanity-translations-tab
```

Unless you are involved in developing this module or a translation plugin, you probably do not need to interact with this package. You likely want to use a vendor-specific plugin, such as [sanity-plugin-studio-smartling](https://github.com/sanity-io/sanity-plugin-studio-smartling)

## Usage

Add the `TranslationsTab` component as a view in your document structure:

```js
import {StructureBuilder as S} from 'sanity/structure'

import {TranslationsTab, DummyAdapter} from 'sanity-translations-tab'

export const getDefaultDocumentNode = ({schemaType}) => {
  if (schemaType === 'translatable') {
    return S.document().views([
      S.view.form(),
      S.view
        .component(TranslationsTab)
        .title('Translations')
        .options({
          // Vendor-specific plugins will have their own adapter, use this for dev
          adapter: DummyAdapter,
          // These two async functions are expected by the plugin
          exportForTranslation: async (props) => props,
          importTranslation: async (props) => props,
          /**
           * If the translation vendor has different workflow options,
           * such as machine translation or human, pass them here and
           * they'll be displayed as Select menu options in the tab.
           * If one or more options are included, there will automatically
           * be a "Default" option that will submit the form with no
           * additional parameters
           */
          workflowOptions: [
            {
              workflowUid: '123',
              workflowName: 'Machine Translation (testing)',
            },
          ],
          /**
           * Optional sync or async function used on translation import to
           * Sanity, if the locale codes used by the translation vendor don't
           * match Sanity's. Receives the vendor locale ID and returns the
           * corresponding Sanity ID.
           */
          localeIdAdapter: (translationVendorId) => sanityId,

          /**
           * the key for the "source content" (for field level) or the code in the
           * language field on the "base document" (for document level)
           *  (e.g. "en" or "en_US").
           */
          baseLanguage: 'en_US',

          /**
           * Format used when writing NEW `translation.metadata` documents.
           * - 'language-field' (default): stores the language in a dedicated `language`
           *   field with a random `_key`, matching `@sanity/document-internationalization` v6.
           * - 'legacy': stores the language id in `_key`, for projects still on the
           *   pre-v6 format.
           * Existing metadata documents keep their detected format regardless of this
           * option. Both formats are read transparently.
           */
          newMetadataFormat: 'language-field',
        }),
    ])
  }

  return S.document()
}
```

## License

[MIT](LICENSE) © Sanity.io

---
_Source: https://npm.io/package/sanity-translations-tab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
