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

@object-ui/i18n

v17.5.0

Published

Internationalization (i18n) support for Object UI with 10+ language packs, RTL layout, and date/currency formatting.

Downloads

2,473

Readme

@object-ui/i18n

Internationalization for Object UI — 11 built-in locales, RTL support, and date/currency formatting.

Features

  • 🌍 11 Built-in Locales - English, Chinese, Japanese, Korean, German, French, Spanish, Portuguese, Russian, Arabic, and more
  • 🔄 RTL Support - Automatic right-to-left layout for Arabic and other RTL languages
  • 📅 Date Formatting - Locale-aware date, datetime, and relative time formatting
  • 💰 Currency & Number Formatting - Locale-aware currency and number formatting
  • 🎣 React Hooks - useObjectTranslation for translations, language switching, and direction
  • 🏗️ I18nProvider - Context provider for internationalized applications
  • 🔌 Extensible - Add custom locales and translation keys
  • 🎯 Type-Safe - Full TypeScript support with exported types

Installation

npm install @object-ui/i18n

Peer Dependencies:

  • react ^18.0.0 || ^19.0.0

Quick Start

import { I18nProvider, useObjectTranslation } from '@object-ui/i18n';

function App() {
  return (
    <I18nProvider config={{ defaultLanguage: 'en' }}>
      <MyComponent />
    </I18nProvider>
  );
}

function MyComponent() {
  const { t, language, changeLanguage, direction } = useObjectTranslation();

  return (
    <div dir={direction}>
      <h1>{t('common.save')}</h1>
      <button onClick={() => changeLanguage('zh')}>Chinese</button>
      <button onClick={() => changeLanguage('ar')}>العربية</button>
    </div>
  );
}

API

I18nProvider

Wraps your application with i18n context:

<I18nProvider config={{ defaultLanguage: 'en', fallbackLanguage: 'en' }}>
  <App />
</I18nProvider>

Language persistence

The active language is a user preference, so it survives a reload: every language change is written to localStorage under objectui-locale (LOCALE_STORAGE_KEY), and the provider boots the next session in that language.

Precedence at bootstrap: stored choice → browser language → defaultLanguage. An explicit choice outranks browser detection — otherwise a user who picked 中文 on a ja browser would be handed ja back on every reload. A stored value the app no longer offers (not a built-in pack, not in config.resources) is ignored and purged, so a stale entry can never lock the UI to a locale with no translations.

// Fixed-language surfaces (previews, demos, screenshot harnesses) opt out —
// they neither restore nor write the preference.
<I18nProvider config={{ defaultLanguage: 'en' }} persistLanguage={false}>
  <Preview />
</I18nProvider>

Bringing your own instance? Then its bootstrap language is yours to choose — read the preference with readStoredLanguage() and pass it to createI18n. Switching through such an instance is still persisted.

useObjectTranslation

Hook for translations and language management:

const { t, language, changeLanguage, direction } = useObjectTranslation();

createI18n

Factory for creating an i18n instance outside React:

import { createI18n } from '@object-ui/i18n';

const i18n = createI18n({ defaultLanguage: 'de' });
i18n.t('common.cancel'); // "Abbrechen"

Formatting Utilities

Locale-aware formatting functions:

import { formatDate, formatCurrency, formatNumber, formatRelativeTime } from '@object-ui/i18n';

formatDate(new Date(), 'en');            // "Jan 1, 2025"
formatCurrency(99.99, 'USD', 'en');      // "$99.99"
formatNumber(1234567, 'de');             // "1.234.567"
formatRelativeTime(-3, 'days', 'en');    // "3 days ago"

Built-in Locales

Import individual locale packs:

import { en, zh, ja, ko, de, fr, es, pt, ru, ar } from '@object-ui/i18n';

RTL Helpers

import { isRTL, RTL_LANGUAGES } from '@object-ui/i18n';

isRTL('ar'); // true
isRTL('en'); // false

Links

License

MIT — see LICENSE.