This is a Sanity Studio v3 plugin.
npm install sanity-plugin-smartling
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',
}),
],
})
MIT © Smartling integrations team
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.