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

i18n4e

v0.9.1

Published

i18n4e is a quick and easy way to add internationalization support to your Express Js application.

Downloads

19

Readme

i18n4e: i18n for Express Js 🎨🌍

npm version npm GitHub license

i18n4e is a package that offers a modern, quick and easy way to add internationalization support to your Express Js application.

🚀 Installation

npm install i18n4e

or

yarn add i18n4e

In the client:

<script src="https://cdn.jsdelivr.net/npm/i18n4e/client-dist/i18n4e.min.js"></script>

or

<script src="/node_modules/i18n4e/client-dist/i18n4e.min.js"></script>

📚 Docs

To see the full documentation, please visit the official documentation.

📖 Simple Usage In 6 Steps

  1. Install the package

    npm install i18n4e
  2. Import the package

    const {i18n4e} = require('i18n4e');
  3. Create a _locales folder in the root of your project and add the locales files

    project
    ├── node_modules
    ├── package.json
    ├── index.js
    └── _locales
        ├── en
        │   └── translation.json
        ├── pt_br
        │   └── translation.json
        └── es
            └── translation.json
    
  4. Add variables in the translation.json files for each language

├── en/translation.json

{
  "hello-world": "Hello World!"
}

├── pt_br/translation.json

{
  "hello-world": "Olá Mundo!"
}

├── es/translation.json

{
  "hello-world": "Hola Mundo!"
}
  1. In your view files (example: index.ejs or index.html) add i18nID attributes to the elements you want to translate

    <h1 i18nID="hello-world">Hello World!</h1>
  2. Start i18n4e on your file by passing your app express

    i18n4e.init(app,{
        defaultLang:'en', // define the main language 
    })

Its done! Now your application is ready to be translated into multiple languages.

For more examples and configurations, please visit the Examples.

💭 Philosophy

i18n4e, created with ❤️ by Luiisp, is a package with the philosophy of demystifying the difficulty of implementing i18n in web applications. At a high level, you can make various complex configurations using only boolean options.

📦 Benefits

  • Modern syntax written with typescript
  • Fast and Scalable Execution
  • ES6/ESM and Common Js support
  • Easy to use
  • Change language by session support
  • HTML/EJS support

🕶️ Examples

We have several ready-made project examples using i18n4e that you can view and use as you wish.

Click to see them 😎

💪 Contributing

We welcome contributions to the i18n4e project! If you would like to contribute, please follow these steps:

  1. Fork the repository on GitHub.
  2. Clone your forked repository to your local machine.
  3. Create a new branch for your changes.
  4. Make your desired changes to the codebase.
  5. Test your changes to ensure they work as expected.
  6. Commit your changes and push them to your forked repository.
  7. Submit a pull request to the main i18n4e repository.

Please make sure to follow our contribution guidelines and adhere to our code of conduct when contributing.

We appreciate your contributions and look forward to working with you!

📝 License

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

inspired by chrome.i18n

Created with ❤️ by luiisp