Socket
Socket
Sign inDemoInstall

sanity-translations-tab

Package Overview
Dependencies
122
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    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 a vendor specific plugin will use this for


Version published
Weekly downloads
737
decreased by-39.29%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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 a vendor specific plugin will use this for its chrome.

Development

  1. Clone this repo into a Studio's plugins directory.
  2. Add "sanity-translations-tab" to the plugins key of sanity.json
  3. Your Studio will need a Desk Structure configuration, here's an example of a schema called translatable
import S from '@sanity/desk-tool/structure-builder'

import {
  TranslationsTab,
  DummyAdapter,
} from '../../plugins/sanity-translations-tab/dist'

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,
        }),
    ])
  }

  return S.document()
}

export default S.defaults()

To work on this module locally, run

npm start

To observe changes to the code, and at the same time run

npx parcel example/index.html

to run the component in a dev server

FAQs

Last updated on 20 Sep 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc