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

@hua-labs/i18n-core

v2.2.0

Published

HUA Labs - Core i18n functionality with SSR/CSR support and state management integration

Readme

@hua-labs/i18n-core

Lightweight, production-ready i18n library for React. Delivers zero-flicker language transitions through intelligent caching, SSR-first hydration handling, and built-in state management integration. ~6.5KB gzipped with zero dependencies (React only).

npm version npm downloads license TypeScript React

Features

  • Zero-flicker — Shows previous language during transition
  • SSR-first — Built-in hydration handling, no mismatch issues
  • Namespace lazy loading — Load translations on demand
  • Pluralization — ICU-compliant plural support via Intl.PluralRules (zero bundle cost)
  • Type-safe arrays — tArray() returns string[] without casting
  • State management — First-class Zustand support via i18n-core-zustand
  • Automatic retry — Exponential backoff for API loader failures
  • React Native — Works in Expo and bare RN projects via CJS/ESM dual format
  • ~6.5KB gzipped — Zero external dependencies
  • Cross-platform — I18nPlatformAdapter for Web, React Native, Flutter bridge
  • Generic getRawValue() — type-safe raw value access without casting

Installation

pnpm add @hua-labs/i18n-core

Peer dependencies: react >=19.0.0

Quick Start

import { createCoreI18n, useTranslation } from '@hua-labs/i18n-core';

const I18nProvider = createCoreI18n({
  defaultLanguage: 'ko',
  fallbackLanguage: 'en',
  namespaces: ['common', 'pages'],
});

export default function Layout({ children }) {
  return <I18nProvider>{children}</I18nProvider>;
}

function Welcome() {
  const { t, tPlural } = useTranslation();
  return (
    <div>
      <h1>{t('common:welcome')}</h1>
      <p>{tPlural('common:total_count', 5)}</p>
    </div>
  );
}

API

| Export | Type | Description | |--------|------|-------------| | useTranslation | hook | Main translation hook — returns t, tPlural, tArray, getRawValue and state | | useLanguageChange | hook | Language change hook with validation against supported languages | | useI18n | hook | Full context hook — all translation functions plus language management | | I18nProvider | component | Direct Provider component (for advanced use) | | Translator | class | Core translator class (for manual instantiation) | | ssrTranslate | function | Server-side translation function (no React needed) | | serverTranslate | function | Server-side translate with full config | | webPlatformAdapter | function | Default web adapter — navigator.language detection + window event language sync | | headlessPlatformAdapter | function | No-op adapter for SSR, testing, and Flutter bridge scenarios | | I18nConfig | type | | | I18nContextType | type | | | TranslationParams | type | | | TypedTranslationKeys | type | | | ResolveStringKey | type | | | ResolveArrayKey | type | | | ResolvePluralKey | type | | | PluralValue | type | | | PluralCategory | type | | | I18nPlatformAdapter | interface | Platform adapter interface — implement for React Native or custom environments | | createCoreI18n | function | Create an i18n Provider component with configuration | | CoreProvider | function | Minimal Provider with zero config | | createLanguageProvider | function | Create a Provider with just a language setting | | createNamespaceProvider | function | Create a Provider with just namespace settings | | createCustomLoaderProvider | function | Create a Provider with custom translation loader |

Documentation

Full Documentation

Related Packages

License

MIT — HUA Labs