Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/document-internationalization

Package Overview
Dependencies
Maintainers
33
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/document-internationalization

> **NOTE** > > This is the **Sanity Studio v3 version** of sanity-plugin-latex-input. > > For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/latex-input).

  • 1.0.0-v3-studio.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
increased by9.77%
Maintainers
33
Weekly downloads
 
Created
Source

Document Internationalization Plugin for Sanity.io

NOTE

This is the Sanity Studio v3 version of sanity-plugin-latex-input.

For the v2 version, please refer to the v2-branch.

npm version

Document Level Internationalization UI

What this plugin solves

There are two popular methods of internationalization in Sanity Studio:

  • Document-level translation
    • A unique document version for every language
    • Joined together by references and/or a predictable _id
    • Best for documents that have unique, language-specific fields and no common content across languages
    • Best for translating content using Portable Text
  • Field-level translation
    • A single document with many languages of content
    • Achieved by mapping over languages on each field, to create an object
    • Best for documents that have a mix of language-specific and common fields
    • Not recommended for Portable Text

This plugin adds features to the Studio to improve handling document-level translations.

  • A Language Selector to create and browse language-specific versions of each Document
  • Document Actions to update base and translated documents to ensure references stay in tact
  • Document Badges to highlight the language version of a document

For field-level translations you should use the @sanity/language-filter plugin.

Studio V3 note: language-filter is not available for V3 yet.

Many projects use both!

Studio V3 note: language-filter is not available for V3 yet.

An example of document-level translation could be a lesson schema, the title, slug and content fields would be unique in every language.

A good use of field-level translation could be a person schema. It could have the same name and image in every language, but only the biography would need translating.

Studio V3 known issues

Studio V3 does not implement language-filter yet. This means that the language button has moved into the document editor flow for the time being. We will be looking to restore the button placement during Studio V3 dev-preview.

Installation

From the same directory as the Studio run:

npm install --save @sanity/document-internationalization@studio-v3

or

yarn add @sanity/document-internationalization@studio-v3

The plugin is now installed, but you will need to complete the following steps to see the Document Translation UI:

Setup next steps

  1. Enabling and configuring the plugin
    To declare available Languages and other settings
  2. Activating internationalization on schema
    To enable all the above features on schema
  3. Customise Desk Structure
    To filter documents down to the base language version

Other documentation

  1. Known Caveats
  2. Data structure
  3. Translation Maintenance
  4. GraphQL support
  5. Advanced languages
  6. Usage with custom publish action
  7. If you don't see the plugin document actions
  8. GROQ query examples

Migrating from sanity-plugin-intl-input

While most of the UI is the same in the official version of this plugin there are some breaking changes you should be aware of before migrating:

Coming from sanity-plugin-intl-input

Keywords

FAQs

Package last updated on 28 Jun 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc