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

localizor

v1.0.4

Published

A packager that will compact all your translation keys onto one single file.

Downloads

22

Readme

localizor

A packager that will compact all your translation keys onto one single file.

Why ?

Managing translation keys always been complicated. You always need to remember to update the translation file when you remove translation usage. In general you end up with a translation file full of un-used keys. And in the most cases, they are complicated to find.

How ?

localizor provides a simpler way to manage your keys. It uses the folder structure to organize keys in the main translation file. Simply create a .locale.yml next to the component which needs the translations, the process will take it and update the main translation file.

For example :

src/components/header.js :

...
<h1>{t('components.header.title')}</h1>
...

src/components/header.locale.yml :

title: Main title

Will be packaged on

src/locales/translations.yml

en:
  components:
    header:
     title: Main title

With this structure, if you want to know if the translation key is still in use, you just have to search after the related component in your components. If it is not, the key is unused. Localizor provides you a file watcher which will automatically update the main translation file for you.

Usage

yarn add localizor -D
yarn localizor

Config

You can configure localizor by adding an .localizorrc file on the root of your project.

Default config is :

{
  root:          'src', // Root folder where it will look for translation files
  localeFile:    'locale', // The extension file for localizor will look (*.[localeFile].[extension], in this example *.locale.yml) 
  extension:     'yml', // (yml || json)
  defaultLocale: 'en', // The root of the translation file 
  targetFile:    'translations', // The path for the main file (/[targetFile].[extension], in this example ./translations.yml)
  watch:         true, // If the script shoud watch file change
  ignoreFiles:   /(^|[\/\\])\../, // Ignores files from being watched ( config here https://github.com/paulmillr/chokidar) 
  watchFolder:   '.' // Folder where localizor should watch for translation files
}