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

@gratise/i18n

v0.1.0

Published

React internationalization with SSR, ICU messages, and translation tooling

Readme

@gratise/i18n

React internationalization with SSR, ICU MessageFormat, JSON catalogs, and an extraction/translation CLI.

Install

pnpm add @gratise/i18n

React and React DOM 19 or newer are peer dependencies. Node.js 24 or newer is required for the CLI.

React and SSR

import { createI18n, I18nProvider, T } from '@gratise/i18n';

const i18n = createI18n({
  locale: 'en',
  fallbackLocale: 'en',
  messages: { en: { welcome: 'Welcome back' }, fr: { welcome: 'Bon retour' } },
});

<I18nProvider i18n={i18n}>
  <T id="welcome">Welcome back</T>
  <T count={3}>{'{count, plural, one {# item} other {# items}}'}</T>
</I18nProvider>;

Create a translator for every incoming server request and use that same locale/catalog snapshot when hydrating in the browser. i18n.t(key, values) and t(i18n, key, values) are available outside React.

Extract and translate catalogs

Create i18n.config.json:

{
  "sourceLocale": "en",
  "locales": ["en", "fr"],
  "source": ["src/**/*.{ts,tsx}"],
  "output": "src/locales",
  "translation": { "provider": "deepl", "apiKeyEnv": "DEEPL_API_KEY" }
}
npx gratise-i18n extract
npx gratise-i18n extract --watch
npx gratise-i18n extract --watch --translate
npx gratise-i18n translate fr

Extraction recognizes <T>literal source text</T>, <T id="stable.key">literal source text</T>, i18n.t('literal key'), and t(i18n, 'literal key'). Catalog entries are added without removing hand-maintained strings. The translator command fills untranslated values and leaves edited target messages in place. Supported providers: OpenAI, Google Cloud Translation, and DeepL. API keys are read from the configured environment variable by the CLI.

extract --watch updates source catalogs; add --translate to also send newly untranslated messages to the configured provider whenever source files change.

Development

corepack pnpm install
pnpm build
pnpm test
pnpm typecheck
pnpm lint

The Rspack build emits ESM and CommonJS bundles plus TypeScript declarations. Documentation lives in apps/docs, and a runnable SSR example lives in examples/ssr. GitHub Actions publishes the docs to GitHub Pages and manages package releases through Changesets.

See Contributing for commit and test conventions, and Publishing setup for the one-time npm/GitHub configuration required from the repository owner.

License

MIT