sanity-plugin-smartling
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

sanity-plugin-smartling

This is a Sanity Studio v3 plugin.

Installation

npm install sanity-plugin-smartling

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import {smartlingPlugin} from 'sanity-plugin-smartling'

const supportedLanguages = [
  {id: 'en', title: 'English'},
  {id: 'fr', title: 'French'},
  {id: 'de', title: 'German'},
];

export default defineConfig({
  //...
  plugins: [
    smartlingPlugin({
      languages: supportedLanguages,
      defaultLanguage: 'en',
    }),
  ],
})

If you use sanity-plugin-internationalized-array then you would need to reuse language set across that and smartling plugins:

import {defineConfig} from 'sanity'
import {internationalizedArray} from 'sanity-plugin-internationalized-array'
import {smartlingPlugin} from 'sanity-plugin-smartling'

const supportedLanguages = [
  {id: 'en', title: 'English'},
  {id: 'fr', title: 'French'},
  {id: 'de', title: 'German'},
];

export default defineConfig({
  //...
  plugins: [
    internationalizedArray({
      languages: supportedLanguages,
      defaultLanguages: ['en'],
      fieldTypes: ['string'],
    }),
    smartlingPlugin({
      languages: supportedLanguages,
      defaultLanguage: 'en',
    }),
  ],
})

License

MIT © Smartling integrations team

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Readme

Keywords

Package Sidebar

Install

npm i sanity-plugin-smartling

Weekly Downloads

3

Version

3.1.0

License

MIT

Unpacked Size

11.3 MB

Total Files

15

Last publish

Collaborators

  • connectors-team