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

react-intl-universal-pseudo-converter

v1.0.1

Published

A utility to convert JSON locale files into pseudo-localization format.

Downloads

354

Readme

react-intl-universal-pseudo-converter

This tool converts a locale source file as the ones used by react-intl-universal and outputs a new file with pseudo-localized strings. The pseudo-localization is carried out by 1stdibs icu-pseudo-translate utility.

Example

I have written a simple example on Repl.it. Simply visit the website, and modify the locale.json file. Once done, hit the run button. The file will be generated on the file system. Since Repl.it doesn't know there is a new file, the UI won't refresh by itself until you make a change, so go ahead and try to add a new file or folder and you will see the pseudo file appear.

The input file is the following:

{
  "Company_label": "Title for the company",
  "navigation": {
    "menu_open": "Open the menu",
    "account_login": "Log in to the account",
    "account_logout": "Log out of the account"
  },
  "about_page": {
    "title": "About page",
    "Subtitle": "Something about the about page"
  }
}

The output from the utility is the following:

{
  "Company_label": "Tïƭℓè ƒôř ƭhè çô₥ƥáñ¥",
  "navigation": {
    "menu_open": "Óƥèñ ƭhè ₥èñú",
    "account_login": "£ôϱ ïñ ƭô ƭhè áççôúñƭ",
    "account_logout": "£ôϱ ôúƭ ôƒ ƭhè áççôúñƭ"
  },
  "about_page": {
    "title": "Âβôúƭ ƥáϱè",
    "Subtitle": "§ô₥èƭhïñϱ áβôúƭ ƭhè áβôúƭ ƥáϱè"
  }
}

Installing

Prerequisites

The package requires you to define an input localization file that uses ICU message format strings with the nested JSON locale format defined by react-intl-universal.

To install it locally, run the following command:

NPM

npm i -g react-intl-universal-pseudo-converter

Yarn

yarn global add react-intl-universal-pseudo-converter

Using the utility

The utility follows the following syntax:

Usage: react-intl-universal-pseudo-converter <command> [options]

Commands:
  react-intl-universal-pseudo-converter create  Creates a pseudo-localized file

Options:
  -f, --file      Input file                                          [required]
  -e, --encoding  File encoding                                [default: "utf8"]
  -o, --output    Output file                    [default: "pseudo.locale.json"]
  -h, --help      Show help                                            [boolean]
  -v, --version   Show version number                                  [boolean]

Examples:
  index create -f en-us.json  creates a pseudo-localized file from 'en-us.json'

Authors

  • Cesar Zapata - Initial work - Ceszare

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments