npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tinloof/sanity-document-i18n

v2.0.2

Published

Sanity document i18n plugin

Readme

@tinloof/sanity-document-i18n

A Sanity Studio plugin that enables internationalization (i18n) for documents with language selection, translation management, and bulk publishing capabilities.

This is a fork of sanity-io/document-internationalization.

Installation

pnpm add @tinloof/sanity-document-i18n

Setup

Add the plugin to your Sanity config:

import {defineConfig} from "sanity";
import {documentI18n} from "@tinloof/sanity-document-i18n";

export default defineConfig({
  plugins: [
    documentI18n({
      locales: [
        {id: "en", title: "English"},
        {id: "fr", title: "Français"},
        {id: "es", title: "Español"},
      ],
    }),
  ],
});

Configuration

The plugin accepts the following configuration options:

  • locales - Array of locale objects with id and title properties
  • languageField - The field name used to store the language/locale value (default: "locale")
  • abstracts - Configuration for abstract schemas (enabled by default with i18n abstract)

Features

  • Multi-language document support with language selection dropdown
  • Language badges on documents for quick visual identification
  • Automatic translation templates for each language
  • Enhanced template management: Automatically removes default templates for localized schema types to avoid confusion
  • Translation metadata management
  • Delete translation actions
  • Duplicate documents with existing translations
  • i18n Abstract: Automatically injected abstract schema for better i18n field organization

i18n Abstract

The plugin now includes an i18n abstract that is automatically injected by default. This abstract helps organize internationalization fields in a consistent way across your schemas.

Default Behavior

The i18n abstract is enabled by default and provides a standardized way to handle i18n fields in your documents. To use this feature, you need to install @tinloof/sanity-extends and wrap your schema types with withExtends:

import {defineConfig} from "sanity";
import {documentI18n} from "@tinloof/sanity-document-i18n";
import {withExtends} from "@tinloof/sanity-extends";

export default defineConfig({
  plugins: [
    documentI18n({
      locales: [
        {id: "en", title: "English"},
        {id: "fr", title: "Français"},
      ],
    }),
  ],
  schema: {
    types: withExtends([
      // Your schema types here
      // Documents can now use: extends: "i18n"
    ]),
  },
});

Note: The withExtends wrapper from @tinloof/sanity-extends is required for the i18n abstract feature to work properly.

Disabling the i18n Abstract

If you prefer not to use the i18n abstract, you can disable it by setting abstracts to false in the plugin configuration:

import {defineConfig} from "sanity";
import {documentI18n} from "@tinloof/sanity-document-i18n";

export default defineConfig({
  plugins: [
    documentI18n({
      locales: [
        {id: "en", title: "English"},
        {id: "fr", title: "Français"},
      ],
      abstracts: false, // Disable the i18n abstract
    }),
  ],
});

License

ISC