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

adelson-localization

v1.1.1

Published

๐ŸŒ Dynamic React localization hook with live translation updates - An alternative to i18next

Readme

๐ŸŒ Adelson Localization

A lightweight, dynamic React localization hook with live translation updates without redeployment.

npm version npm downloads License: MIT TypeScript

๐ŸŽ‰ What's New in v1.1.0

  • ๐Ÿ“ Multiple Resource Files - Split translations across multiple files for better organization
  • ๐Ÿ”ง Utility Functions - Export deepMerge and strictDeepMerge for custom use cases
  • โœ… 64 Tests - Comprehensive test coverage for reliability
  • ๐Ÿ”’ Zero Dependencies - Lightweight and secure (dev dependencies only)

๐Ÿ“‹ See full changelog โ†’


๐Ÿš€ Why Adelson Localization?

| Feature | Adelson Localization | i18next | |---------|---------------------|---------| | Live Updates | โœ… Update translations on server, users get updates on next load | โš ๏ธ Requires rebuild | | Dynamic Formatting | โœ… Mix indexed {{}} and named {{name}} placeholders | โœ… Named only | | Plural Rules | โœ… Built-in (7 languages) | โœ… Via plugins | | TypeScript Generics | โœ… ln<T>() for any type | โš ๏ธ Limited | | Bundle Size | ๐Ÿชถ ~5KB minified | ๐Ÿ“ฆ Varies with plugins | | Setup | ๐Ÿš€ Single hook, zero config | ๐Ÿ”ง Provider setup required |

๐Ÿ”ฅ Key Advantage: Update Translations Without Redeployment

Update your translation files on the server, and users get the latest content on next page load or language change without app redeployment.

๐Ÿ“– See detailed comparison with i18next โ†’


๐ŸŽฎ Live Demo

Try adelson-localization instantly in your browser:

Open in StackBlitz

No installation required! Fork, modify, and test in seconds.

๐Ÿ“บ See all demos and examples โ†’


๐Ÿ“ฆ Installation

npm install adelson-localization
# or
yarn add adelson-localization

๐ŸŽฏ Quick Start

1. Create translation files

/public/locales/en/translation.json
{
  "app": {
    "title": "My Application",
    "welcome": "Welcome {{}}!"
  },
  "messages": {
    "notification": {
      "singular": "You have {{}} new message",
      "plural": "You have {{}} new messages"
    }
  }
}

2. Use the hook in your component

import { useLanguage } from 'adelson-localization';

function App() {
  const { ln, lnPlural, language, setLanguage } = useLanguage({ lang: "en" });

  return (
    <div>
      <h1>{ln("app.title")}</h1>
      <p>{ln("app.welcome", "John")}</p>
      <p>{lnPlural("messages.notification", 5)}</p>
      
      <button onClick={() => setLanguage({ key: "fr" })}>
        Switch to French
      </button>
    </div>
  );
}

๐Ÿ“š See more examples โ†’


๐Ÿ“– Documentation

Core Features

Advanced Features (v1.1.0+)

Migration & Best Practices


โšก Key Features

Multiple Resource Files (v1.1.0+)

Split translations across multiple files for better organization:

const { ln } = useLanguage({ 
  lang: "en",
  resourceFiles: ["common.json", "auth.json", "dashboard.json"]
});

ln("common.buttons.save")      // from common.json
ln("auth.login.title")         // from auth.json
ln("dashboard.stats.users")    // from dashboard.json

๐Ÿ“ Learn more about multiple resource files โ†’

Hot Module Replacement (HMR)

Auto-reload translations during development:

const { ln } = useLanguage({ 
  lang: "en",
  enableHMR: true  // โšก Translations update automatically
});

๐Ÿ”ฅ Learn more about HMR โ†’

TypeScript Generics

Type-safe data retrieval:

const maxItems = ln<number>("config.maxItems");
const features = ln<string[]>("config.features");
const settings = ln<AppSettings>("app.settings");

๐Ÿ’ก See TypeScript examples โ†’

Plural Support

Built-in plural rules for 7 languages (EN, FR, ES, DE, IT, PT, NL):

lnPlural("messages.notification", 1);  // "You have 1 new message"
lnPlural("messages.notification", 5);  // "You have 5 new messages"

๐ŸŒ Learn about plural rules โ†’


๐Ÿ”ง Utility Functions (v1.1.0+)

Export utility functions for your own use:

import { deepMerge, strictDeepMerge } from 'adelson-localization';

// Deep merge objects
const config = deepMerge(defaults, userPrefs, overrides);

// Strict merge (only updates existing keys)
strictDeepMerge(schema, updates);

๐Ÿ”จ See utility functions documentation โ†’


๐Ÿ“‹ API Quick Reference

interface UseLanguageConfig {
  lang?: string;              // Initial language (default: "en")
  translationsUrl?: string;   // Base URL (default: "/locales")
  managedLanguages?: string[]; // Supported languages (default: ["en", "fr", "es"])
  enableHMR?: boolean;         // Enable HMR in dev (default: false)
  resourceFiles?: string[];    // ๐Ÿ†• Files to load (default: ["translation.json"])
}

const { 
  ln,                    // Localization function
  lnPlural,              // Plural localization
  language,              // Current language
  setLanguage,           // Change language
  resource,              // Raw translation data
  loadingResource        // Loading state
} = useLanguage(config);

๐Ÿ“˜ Full API Reference โ†’


๐Ÿ†š Comparison with i18next

| Scenario | Choose Adelson Localization | Choose i18next | |----------|----------------------------|----------------| | Simple setup needed | โœ… | โŒ | | Live updates without rebuild | โœ… | โŒ | | Lightweight bundle | โœ… | โŒ | | Complex namespaces | โŒ | โœ… | | Extensive plugins | โŒ | โœ… | | Backend integration | โš ๏ธ Manual | โœ… Built-in |

๐Ÿ“Š Detailed comparison โ†’


๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

MIT ยฉ Jean Junior Adelson


๐Ÿ™ Acknowledgments

Created by Jean Junior Adelson as a modern, lightweight alternative to existing i18n solutions.


๐Ÿ“ž Support


Made with โค๏ธ by Jean Junior Adelson