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

payload-intl

v1.4.5

Published

Payload Plugin for I18N using ICU Messages

Downloads

1,552

Readme

payload-intl

Schema-driven internationalization for Payload CMS using ICU MessageFormat.

npm version License: MIT

Overview

Define your message keys as a typed schema using ICU MessageFormat syntax, then manage translations across locales in a rich admin UI with validation, autocompletion, and support for plurals, selects, dates, and tags. Messages can be fetched server-side or client-side.

Features

  • ICU MessageFormat — variables, plurals, selects, number/date/time formatting, and XML-like tags.
  • Schema-driven — define message keys and templates in a typed schema with automatic validation.
  • Rich editor UI — message editor with variable chips, autocompletion, and inline ICU element editors.
  • JSON import — bulk-import translations from JSON files directly in the admin UI.
  • Flexible storage — store translations as JSON in the database (default) or as uploaded files for CDN hosting.

Installation

pnpm add payload-intl

Usage

// payload.config.ts
import { buildConfig } from "payload";
import { intlPlugin } from "payload-intl";

export default buildConfig({
  localization: {
    locales: ["en", "de", "fr"],
    defaultLocale: "en",
  },
  // ...
  plugins: [
    intlPlugin({
      schema: {
        common: {
          greeting: "[Main greeting] Hello {name}!",
          items: "{count, plural, one {# item} other {# items}}",
        },
        auth: {
          login: "Sign in",
          logout: "Sign out",
        },
      },
      tabs: true,
    }),
  ],
});

Scoped messages on globals

Colocate translations with the globals they belong to by adding scopes:

intlPlugin({
  schema: {
    navigation: { home: "Home", about: "About" },
    common: { greeting: "Hello {name}!" },
  },
  scopes: ["navigation"],
  // or with position control:
  // scopes: { navigation: 'sidebar' }
  // scopes: { navigation: { position: 'tab', existingFieldsTabLabel: 'Nav Fields' } }
});

The navigation key will be edited on the navigation global (in a Messages tab by default), while common stays in the /intl view.

Fetch messages in your application:

import { fetchMessages } from "payload-intl";

const messages = await fetchMessages(payload, "en");

Options

| Option | Type | Default | Description | | ---------------- | ------------------------------------------------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | schema | MessagesSchema | — | Required. Nested object defining message keys and ICU templates. Leaf values are ICU MessageFormat strings, optionally prefixed with a [description]. | | storage | 'db' \| 'upload' | 'db' | 'db' stores translations as JSON in the database. 'upload' stores them as uploaded .json files for CDN/static hosting. | | scopes | MessagesScopesConfig | — | Colocate translation editing with Payload globals. Maps top-level schema keys to globals, adding a Messages tab or sidebar. Accepts an array of slugs or a record with position config. | | tabs | boolean | false | When enabled, top-level schema keys are rendered as tabs in the admin UI. | | collectionSlug | string | 'messages' | Slug of the collection used to store translation documents. | | editorAccess | (req: PayloadRequest) => boolean \| Promise<boolean> | (req) => req.user !== null | Access control function that determines who can edit messages. | | hooks | MessagesHooks | {} | Collection hooks. Extends Payload's collection hooks with an additional afterUpdate callback fired when translations are saved. |

Note: Switching between storage strategies on an existing deployment is not yet supported automatically. When the database schema changes (e.g. dropping upload columns), the migration data is lost before the app can read it. A safe migration path will be provided in a future release. For now, export your translations before switching strategies.

Contributing

This plugin lives in the payload-plugins monorepo.

Development

pnpm install

# watch this plugin for changes
pnpm --filter payload-intl dev

# run the Payload dev app (in a second terminal)
pnpm --filter sandbox dev

The sandbox/ directory is a Next.js + Payload app that imports plugins via workspace:* — use it to test changes locally.

Code quality

  • Formatting & linting — handled by Biome, enforced on commit via husky + lint-staged.
  • Commits — must follow Conventional Commits with a valid scope (e.g. fix(payload-intl): ...).
  • Changesets — please include a changeset in your PR by running pnpm release.

Issues & PRs

Bug reports and feature requests are welcome — open an issue.

License

MIT