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

@inlang/plugin-icu1

v1.0.0

Published

--- og:title: ICU MessageFormat v1 Plugin og:description: Storage plugin for inlang that reads and writes ICU MessageFormat v1 JSON files. Supports selects, plurals, selectordinal, offsets, and formatter styles. ---

Readme


og:title: ICU MessageFormat v1 Plugin og:description: Storage plugin for inlang that reads and writes ICU MessageFormat v1 JSON files. Supports selects, plurals, selectordinal, offsets, and formatter styles.

ICU MessageFormat v1 Plugin

The ICU MessageFormat v1 plugin is a storage plugin for inlang. It reads and writes ICU1 strings in JSON files per locale. It targets ICU MessageFormat v1 (a.k.a. ICU MessageFormat) and maps it onto inlang's data model so selectors and variants are preserved.

Features

  • Parses ICU1 messages using @messageformat/parser.
  • Supports select, plural, and selectordinal, including exact matches (=n) and offset.
  • Supports # (octothorpe) inside plural/selectordinal cases.
  • Supports formatter functions (e.g. number, date, time, spellout, ordinal, duration) with style parameters.
  • Exports ICU1 strings back from inlang data.

Installation

Install the plugin in your Inlang Project by adding it to your modules in project.inlang/settings.json and configure pathPattern.

// project.inlang/settings.json
{
  "modules": [
+    "https://cdn.jsdelivr.net/npm/@inlang/plugin-icu1@latest/dist/index.js"
  ],
+ "plugin.inlang.icu-messageformat-1": {
+   "pathPattern": "./messages/{locale}.json"
+ }
}

Configuration

Configuration happens in project.inlang/settings.json under "plugin.inlang.icu-messageformat-1".

pathPattern

You can define a single pathPattern or provide an array of patterns. The placeholder should be {locale}.

Single path pattern example

{
  "plugin.inlang.icu-messageformat-1": {
    "pathPattern": "./messages/{locale}.json"
  }
}

Multiple path patterns example

{
  "plugin.inlang.icu-messageformat-1": {
    "pathPattern": ["./defaults/{locale}.json", "./product/{locale}.json"]
  }
}

[!NOTE] When exporting, all messages are written to every path pattern in the array (one file per pattern and locale). Multiple patterns are a one-way merge for import.

Messages

ICU1 files contain key-value pairs with ICU MessageFormat strings.

// messages/en.json
{
  "hello_world": "Hello World!",
  "greeting": "Good morning {name}!",
  "likes": "You have {count, plural, one {# like} other {# likes}}"
}

Plurals and selectordinal

{
  "items": "{count, plural, offset:1 =0 {no items} one {# item} other {# items}}",
  "rank": "{place, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}"
}

Select

{
  "gender": "{gender, select, male {He} female {She} other {They}}"
}

Escaping

ICU1 uses apostrophes to escape literals. To include literal braces, wrap them in apostrophes:

  • `'{'
  • '}'

If you need a literal apostrophe, use '' (two single quotes).

Caveats

  • Export is canonicalized. Output is semantically equivalent, but whitespace and formatting may differ from the original source.
  • Tags/markup are treated as plain text by the parser.