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

@cellarnode/i18n

v0.3.3

Published

Shared i18n configuration for CellarNode frontends — language constants, i18next factory, browser locale detection, and common translations.

Readme

@cellarnode/i18n

Shared i18n configuration for CellarNode frontends — language constants, i18next factory, browser locale detection, and common translations.

Install

pnpm add @cellarnode/i18n react-i18next i18next i18next-http-backend i18next-browser-languagedetector

Usage

Initialize i18next

// src/lib/i18n.ts
import { createI18nInstance } from "@cellarnode/i18n";

const i18n = createI18nInstance({
  defaultNS: "common",
  ns: ["common", "navigation"],
  loadPath: "/locales/{{lng}}/{{ns}}.json",
});

export default i18n;

Wrap your app

import { I18nextProvider } from "react-i18next";
import i18n from "@/lib/i18n";

function App() {
  return (
    <I18nextProvider i18n={i18n}>
      <YourApp />
    </I18nextProvider>
  );
}

Translate strings

import { useTranslation } from "react-i18next";

function MyComponent() {
  const { t } = useTranslation("common");
  return <button>{t("save")}</button>;
}

Detect browser language

import { resolveLanguageFromBrowser } from "@cellarnode/i18n";

// Maps regional variants to supported languages
resolveLanguageFromBrowser("fr-CA"); // "fr"
resolveLanguageFromBrowser("zh-Hans-CN"); // "zh"
resolveLanguageFromBrowser("ja"); // "en" (fallback)

Copy common translations (build script)

Add to your package.json scripts to copy shared common.json files into your project:

{
  "scripts": {
    "predev": "node --input-type=module -e \"import '@cellarnode/i18n/scripts/copy-common'\"",
    "prebuild": "node --input-type=module -e \"import '@cellarnode/i18n/scripts/copy-common'\""
  }
}

This copies locales/{lang}/common.json from the installed package into public/locales/{lang}/common.json.

Exports

@cellarnode/i18n

| Export | Description | |--------|-------------| | createI18nInstance(options) | i18next factory with HttpBackend + LanguageDetector | | resolveLanguageFromBrowser(locale) | Maps browser locale to supported language | | getLanguageDisplayName(lang) | Returns native display name (e.g., "Svenska") | | SUPPORTED_LANGUAGES | ['en', 'zh', 'fr', 'de', 'it', 'es', 'sv'] | | DEFAULT_LANGUAGE | 'en' | | LANGUAGE_DISPLAY_NAMES | Map of codes to native names | | SupportedLanguage | TypeScript union type |

@cellarnode/i18n/locales/*

JSON translation files for all 7 languages. Currently includes common.json.

@cellarnode/i18n/scripts/copy-common

CLI script that copies common locale files from the package into public/locales/.

Supported Languages

| Code | Language | Native | |------|----------|--------| | en | English | English | | zh | Chinese (Simplified) | 中文 | | fr | French | Francais | | de | German | Deutsch | | it | Italian | Italiano | | es | Spanish | Espanol | | sv | Swedish | Svenska |

License

MIT