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

@webmobix/i18next-plugins

v0.0.4

Published

i18next backend and postProcessor plugins for Leo Translate

Downloads

519

Readme

@leo-translate/i18next-plugins

i18next backend and post-processor plugins for Leo Translate.

Installation

pnpm add @leo-translate/i18next-plugins

Plugins

LeoBackend

A custom i18next backend that fetches translation JSON files from a remote URL (e.g. Cloudflare R2).

Translation files are resolved using the pattern:

{remoteUrl}/{appId}/{language}/{namespace}.json

Options

| Option | Type | Default | Description | | ----------------------- | --------------------- | --------------------------- | --------------------------------------------------------- | | appId | string \| undefined | undefined | The ID of the application. Required for fetching to work. | | remoteUrl | string | Leo Translate R2 public URL | Base URL for fetching translation files. | | localStorageKeyPrefix | string | 'leo-translate' | Key prefix used by the Chrome extension for overrides. |


LeoPostProcessor

A pass-through i18next post-processor stub. Register it with i18next and opt in per translation call or globally.


Usage

Option 1 — Root import

Import both plugins from the package root:

import { LeoBackend, LeoPostProcessor } from '@leo-translate/i18next-plugins';
import i18n from 'i18next';

i18n
  .use(LeoBackend)
  .use(LeoPostProcessor)
  .init({
    backend: {
      appId: 'my-app',
      remoteUrl: 'https://translations.example.com',
    },
  });

Option 2 — Sub-path imports

Import each plugin individually from its own sub-path:

import { LeoBackend } from '@leo-translate/i18next-plugins/backend';
import { LeoPostProcessor } from '@leo-translate/i18next-plugins/post-processor';
import i18n from 'i18next';

i18n
  .use(LeoBackend)
  .use(LeoPostProcessor)
  .init({
    backend: {
      appId: 'my-app',
      remoteUrl: 'https://translations.example.com',
    },
  });

Sub-path imports are useful when you only need one plugin and want to avoid pulling in the other.


CLI — leo-translate

The package ships a leo-translate binary for managing translation bundles from the command line.

Installation

Install the package globally or as a dev dependency to make the binary available:

# global
pnpm add -g @leo-translate/i18next-plugins

# dev dependency (run via pnpm exec or package.json scripts)
pnpm add -D @leo-translate/i18next-plugins

Commands

leo-translate import <folder>

Discovers all i18next namespace JSON files under a locale folder and uploads them to the Leo Translate backend.

Folder structure expected:

locales/
  en/
    common.json
    dashboard.json
  de/
    common.json
    dashboard.json

Usage:

leo-translate import ./locales --app-id my-app

Options:

| Flag | Type | Default | Description | | ------------- | --------- | ----------------------------------- | --------------------------------------------------------------------------- | | --app-id | string | — | Required. Leo Translate app ID (slug). | | --url | string | https://leo-translate.webmobix.io | Backend URL to upload to. | | --overwrite | boolean | false | Overwrite existing published values. By default, existing keys are skipped. | | --dry-run | boolean | false | Print the full import plan without making any changes. | | --language | string | all languages | Import only the specified language subfolder (e.g. en). |

Examples:

# Preview what would be imported
leo-translate import ./locales --app-id my-app --dry-run

# Import only English, overwriting existing keys
leo-translate import ./locales --app-id my-app --language en --overwrite

# Import to a self-hosted backend
leo-translate import ./locales --app-id my-app --url https://translate.example.com

Authentication:

The first time a live import is run, the CLI opens a browser window to complete an OAuth 2.0 PKCE login flow. After a successful login the token is cached in ~/.leo-translate/credentials.json (mode 0600) and reused on subsequent runs until it expires.

Import results:

After each upload the CLI prints a per-namespace summary of created, updated, and skipped keys. If any errors are returned by the API the CLI exits with code 1.


leo-translate logout

Clears the locally cached authentication token. The next command that requires auth will re-trigger the browser login flow.

leo-translate logout