3.1.1 • Published 6 months ago
sanity-plugin-smartling v3.1.1
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.