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 🙏

© 2025 – Pkg Stats / Ryan Hefner

whoa-i18n

v0.1.0

Published

[![NPM version][npm-image]][npm-url] [![NPM downloads][downloads-image]][downloads-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]

Downloads

4

Readme

whoa i18n

[![NPM version][npm-image]][npm-url] [![NPM downloads][downloads-image]][downloads-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]

Simple and ergonomic tooling for managing translations.

Installation

# Locally in your project
npm install -D whoa-i18n

# Or globally
npm install -g whoa-i18n

Tip: Installing modules locally allows you to control and share the versions through package.json.

Usage

# Generate types into a declaration file
whoa types > whoa.d.ts

# Generate declaration compatible JavaScript into a file
whoa js > whoa.js

# Generate strict TypeScript into a file
whoa ts > whoa.ts

# Generate i18n schema into a file
whoa schema > i18n.schema.json

# Start an author-server
whoa author-server

i18n files

Structure

The basic i18n file consists of a filename (sans extension), and a content body following a YAML structure.

favoriteFruits.i18n

orange:
  one:
    en: Orange
    es: Naranja
  two:
    en: Two Oranges
    es: Dos Naranjas
  three:
    en: Three Oranges
    es: Tres Naranjas
  other:
    vars:
      n: number of
    en: $n$ Oranges
    es: $n$ Naranjas

This translation can then be accessed in your client.html code

const whoa = require("./whoa")

whoa("favoriteFruits").key("orange.one").s()
//=> Orange
whoa("favoriteFruits").key("orange.other").s({ n: '8' })
//=> 8 Oranges

// Change language
whoa.lang = "es"

whoa("favoriteFruits").key("orange.one").s()
//=> Naranja
whoa("favoriteFruits").key("orange.other").s({ n: '8' })
//=> 8 Naranjas

// If our translation file does not support a key, we can pass in a placeholder template
whoa("favoriteFruits").key("grapes.one", "Grape").s()
//=> Grape
whoa("favoriteFruits").key("grapes.other", "$n$ Grapes").s({ s: '5' })
//=> 5 Grapes

Authoring in VS Code

Authoring in VS Code and other editors may be very similar.

An easy way to get started is to generate a schema file to check your translation yaml files.

# Generate a JSON schema file for two locales "en" (English) and "es" (Spanish)

whoa -L en,es schema > i18n.schema.json

Then, with our editor we can set up a yaml plugin like redhat.vscode-yaml to validate all our **/*.i18n files to that schema. And, ensure that all *.i18n files are associated to yaml.

.vscode/settings.json

{
    "yaml.schemas": {
        "./i18n.schema.json": "**/*.i18n"
    },
    "files.associations": {
        "*.i18n": "yaml"
    }
}