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

@bota-apps/translations

v0.3.4

Published

Shared translation runtime: preconfigured singleton + TranslationProvider, createAppTranslations for registering app-local locale bundles with a typed hook, useTranslations, translateEnum, a scoped translator context, imperative language helpers, and a se

Readme

@bota-apps/translations

Shared translation runtime for @bota-apps apps: a preconfigured process-wide singleton (en fallback, bota:locale localStorage persistence, browser language detection), a TranslationProvider, and createAppTranslations — the factory apps use to register their app-local locale bundles and get a namespace-typed translation hook. Locale bundles themselves stay in the app (under src/translations/locales); this package is only the runtime.

The name is deliberately engine-neutral: it currently wraps i18next, but that is an implementation detail. Consumers depend on @bota-apps/translations alone — never on i18next / react-i18next directly — so the engine can change without touching a single call site. This is the sole package permitted to own the i18next dependency; no other @bota-apps package may depend on it.

Install

pnpm add @bota-apps/translations
# peer: react

Usage

Register the app's bundles once at module scope and re-export the typed hook:

// app: src/translations/index.ts
import { createAppTranslations, TranslationProvider } from "@bota-apps/translations";
import { en } from "./locales/en";
import { am } from "./locales/am";

// The app path already scopes the hook — no need to re-prefix
// (`@tasks/translations` → `useAppTranslations`, not `useTasksAppTranslations`).
export const { useAppTranslations } = createAppTranslations({ resources: { en, am } });
export { TranslationProvider };

Mount the provider once at the app root:

import { TranslationProvider } from "@tasks/translations";

<TranslationProvider>
  <App />
</TranslationProvider>;

Read translations anywhere — the namespace union is typed from the en bundle:

import { useAppTranslations } from "@tasks/translations";

const { t } = useAppTranslations("common");

The first createAppTranslations call initializes the singleton (pass initOptions there to replace defaultInitOptions wholesale); later calls — e.g. from embedded extensions — only add their bundles. The i18next CustomTypeOptions augmentation ships with the package, so importing anything from @bota-apps/translations pulls it in — apps do not declare their own.

API

| Export | What | | -------------------------------------------------- | ------------------------------------------------------------------------------------------- | | createAppTranslations | Registers app-local locale bundles and returns a namespace-typed useAppTranslations hook. | | TranslationProvider | Mounts the translation runtime for the React tree. | | useTranslations(ns) | Lower-level namespace hook (prefer the typed hook from createAppTranslations). | | changeLanguage(lng) / getLanguage() | Imperative, engine-agnostic language control (switches every mounted surface at once). | | defaultInitOptions | The default init options the singleton boots with. | | translateEnum(values, t, prefix) | Enum values → translated { value, label } options, looked up as ${prefix}.${value}. | | ScopedTranslatorProvider / useScopedTranslator | Share a pre-bound translator through layout layers without prop-drilling. | | getServerTranslation(lng, ns?) / serverI18n | SSR / Node-side translation — switches the singleton and returns a bound t. |

Types re-exported so consumers never import i18next directly: SupportedLanguage, ToStringLeaves, TFunction, Namespace.

Subpaths

| Import | What | | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | @bota-apps/translations | The React runtime: provider, createAppTranslations, hooks, translator, enum/server helpers. | | @bota-apps/translations/coverage | React-free coverage utilities (flattenBundleKeys, findMissingKeys, expectedKeysFromSchemas) — compare bundles in a test. | | @bota-apps/translations/testing | Drive the pure localize transforms against a nested bundle (bundleLocalizeContext, resolveBundleKey) without booting i18next. | | @bota-apps/translations/review | Node-only translation-review worksheet generator (runTranslationReview, TranslationReviewError). | | bota-translation-review (bin) | CLI wrapper over the review module for generating/approving/checking review worksheets. |

Part of the @bota-apps packages monorepo.