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

i18nifty

v3.2.1

Published

Type safe React i18n library

Downloads

614

Readme

An internationalization and translation (i18n) library for React that focuses on the developer experience.
With ChatGPT capable of producing high-quality translations, there's no longer a need to rely on third-party translation services.
This allows us to shift our attention from making resource files editable in spreadsheet software to enhancing the developer experience.
In i18nifty, everything is TypeScript and type-safe. You can define your translations as functions and return them as React nodes, making the process more expressive, easier to write, and simpler to maintain.

i18nifty is intended for use in Single Page Application (SPA) projects, such as Vite or Create React App. It is not designed for use with Next.js or other SSR/SSG-enabled meta-frameworks.

What do I expect from my i18n library

  • [x] I want true type safety, If I forgot something I want to be warned about it at compile time. I want to be guided by intelisence through and through so I can focus on my content.
  • [x] I want to be able to use React components and involve JS logic in my translations (even if it means giving up support for third part translations services like https://locize.com/).
  • [x] I want the language to default to the browser preference.
  • [x] I want the language preferences to be persistent across reloads.
  • [x] I want asynchronous loading of locales
  • [x] SEO: I want to let Google know that my website is available in multiple languages.
  • [x] I want to be able to change the language of my app by adding ?lang=xx to the URL without involving my routing library.
  • [x] I want to be able to explicitly fallback to English (or another language) when the translation for a given language is incomplete.
  • [x] a11y: When internationalized text received from the backend aren't in the language of the app I want a label to be added
  • [x] Bundle size: I want only one translation to be downloaded. If the user select another language the required resources must be downloaded dynamically.

i18nifty is the only library i18n library (at the time of writing theses lines) that checks all the boxes. Discover.

demo_1_gh demo_2_gh demo_3

Showcases

This library has been used to build the following projects:

## Contributing

git clone https://github.com/garronej/i18nifty
cd i18nifty
yarn

# Start the test app in watch mode
yarn start-test-app
# Start the alternative test app where resources are split into multiples files to enable lazy loading.
yarn start-test-app-lazy

# Link in an external app.
yarn link-in-app YOUR-APP # ../YOUR-APP is supposed to exist
npx tsc -w