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

@dmhd6219/i18next-slavic

v0.1.0

Published

Typed Slavic-case (declension) helper hook for react-i18next, plus a CLI that generates resource types from your locale JSON.

Readme

i18next-slavic

Typed Slavic-case (declension) helper for react-i18next, plus a small CLI that generates fully-typed resource definitions from your locale JSON.

Slavic languages (Russian, Ukrainian, Polish, …) inflect nouns across six grammatical cases. i18next-slavic maps each case to an i18next context, so you keep one translation key and let i18next pick the right form — with full TypeScript autocomplete on your keys.

Install

npm install @dmhd6219/i18next-slavic
# peers (you almost certainly already have these):
npm install i18next react-i18next react

The hook

import { useSlavicTranslation } from '@dmhd6219/i18next-slavic';

function Greeting() {
  const { tCase, t } = useSlavicTranslation('common');

  return (
    <p>
      {/* "Добро пожаловать в Москву" — resolved from `city_accusative` */}
      Добро пожаловать в {tCase('city', 'accusative')}
    </p>
  );
}

useSlavicTranslation is a thin wrapper over useTranslation and returns the usual { t, i18n, ready } plus:

tCase(
  key: TranslationKey,          // typed from your own resources
  wordCase: SlavicCase,         // 'nominative' | 'genitive' | 'dative' | …
  options?: TOptions,
  defaultValue?: string,
): string

SlavicCase covers all six cases:

type SlavicCase =
  | 'nominative'
  | 'genitive'
  | 'dative'
  | 'accusative'
  | 'instrumental'
  | 'prepositional';

Locale JSON

Provide one base key plus a context-suffixed variant per case:

{
  "city": "Москва",
  "city_genitive": "Москвы",
  "city_dative": "Москве",
  "city_accusative": "Москву",
  "city_instrumental": "Москвой",
  "city_prepositional": "Москве"
}

The CLI

The bundled i18next-slavic command scans your locale JSON and writes a typed Resources interface plus the i18next module augmentation that powers autocomplete in the hook.

npx @dmhd6219/i18next-slavic --locales public/locales/ru --out src/@types/resources.d.ts

After installing, the local bin is exposed as i18next-slavic, so inside an npm script you can call it directly (see below).

| Option | Alias | Default | Description | | ------ | ----- | ------- | ----------- | | --locales <dir> | -l | public/locales/ru | Locale folder to read | | --out <file> | -o | src/@types/resources.d.ts | Output .d.ts file | | --default-ns <ns> | -n | common | defaultNS written into i18next.d.ts | | --cwd <dir> | -c | auto-detected | Project root | | --help | -h | | Show help |

It writes two files:

  • <out> — the Resources interface, regenerated on every run.
  • <out-dir>/i18next.d.ts — the i18next augmentation, created once and then left untouched so your manual tweaks survive.

Add it to your scripts so types stay in sync:

{
  "scripts": {
    "i18n:types": "i18next-slavic"
  }
}

Context/plural variants (keys containing _) are intentionally excluded from the generated key union — you reference the base key and pass the case to tCase.

License

MIT