Skip to content

A translation management plugin for Sanity, powered by Lilt.

Notifications You must be signed in to change notification settings

lilt/sanity-plugin-lilt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Installation

Setup

  1. Update NPM access

    1. In the root of your Sanity project, create a .npmrc file if it doesn’t exist.

    2. Generate a classic GitHub token.

    3. Add the scope read:packages.

    4. Paste the token into .npmrc:

      //npm.pkg.github.com/:_authToken={yout-auth-token}
      @lilt:registry=https://npm.pkg.github.com
      always-auth=true
  2. Install the plugin You can use either NPM or Yarn:

    npm install @lilt/[email protected]
    # or
    yarn add @lilt/[email protected]
  3. Update sanity.config.ts Import and register the plugin:

    import { defineConfig } from 'sanity'
    import { liltPlugin } from '@lilt/sanity-plugin'
    
    export default defineConfig({
      // ...
      plugins: [
        liltPlugin(),
        // other plugins...
      ]
      // ...
    })

Requirements

This plugin depends on Sanity’s documentInternationalization plugin to handle multilingual document structures.

Make sure you have it installed and configured before enabling the Lilt plugin:

npm install @sanity/document-internationalization

Then add it to your sanity.config.ts:

import { documentInternationalization } from '@sanity/document-internationalization'

export default defineConfig({
  // ...
  plugins: [
    documentInternationalization({
      // configure your supported languages here
      supportedLanguages: [
        { id: 'en', title: 'English' },
        { id: 'de', title: 'German' },
        { id: 'fr', title: 'French' },
      ],
      schemaTypes: ['page', 'post'], // schema types you want to translate
    }),
    liltPlugin(),
  ]
})

About

A translation management plugin for Sanity, powered by Lilt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published