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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bluecateng/l10n-cli

v0.2.0

Published

Command line utilities for l10n

Downloads

980

Readme

@bluecateng/l10n-cli

Command line utilities for l10n.

Installation

npm i -D @bluecateng/l10n-cli

Configuration

Add an object with this format to package.json. All paths are relative to the directory where package.json is located.

"bc-l10n": {
  "hashLength": <number>,
  "sourcePath": <string>,
  "module": <string>,
  "catalogPath": <string>,
  "locales": <Array<string>>
}

hashLength

To save space in production the code only contains a hash of the original string. This field specifies the length to which the hashes will be truncated. It should be the minimum length which avoids clashes, clashes are validated at build time.

  • Required: yes
  • Example: 3

sourcePath

The path to the sources.

  • Required: no
  • Default: "src"

module

The path to the module which loads the strings (see @bluecateng/l10n-core).

  • Required: yes
  • Example: "src/l10n"

catalogPath

The path where the message catalog files will be created. It must contain the token "{locale}" which will be replaced with the corresponding locale. It must not contain an extension, the extension will be appended on generation.

  • Required: yes
  • Example: "src/l10n/{locale}"

locales

List of BCP-47 locale codes.

  • Required: no
  • Default: ["en"]
  • Example: ["en", "fr"]

Usage

The command line can be used in two modes:

  • during development to extract strings from individual files for a single locale.
  • before committing to extract strings from all source files for all configured locales.

npx @bluecateng/l10n-cli [ -l <locale> ] [ <file-paths> ... ]

locale

The single locale code to update. If not specified, all the configured locales will be updated.

file-paths

The paths to the source files from which strings will be extracted. If not specified, all the source files will be scanned.

Usage as a file watcher in JetBrains IDEs (WebStorm/IDEA)

This configuration can be added under Settings > Tools > File Watchers.

PO file watcher configuration