I18n screenshot

I18n

Author Avatar Theme by Nanostores
Updated: 27 Jul 2025
270 Stars

A tiny (≈600 bytes) i18n library for React/Preact/Vue/Svelte

Categories

Overview

Nano Stores I18n is a small, flexible JavaScript library that allows you to make your web application translatable. It uses the Nano Stores state manager and the JS Internationalization API. The library is lightweight, with a size of around 1 KB (minified and gzipped), and has zero dependencies. It works seamlessly with popular JavaScript frameworks such as React, Preact, Vue, Svelte, and plain JS. Nano Stores I18n also supports tree-shaking and on-demand translation downloading. It uses plain flat JSON translations that are compatible with online translation services. Additionally, Nano Stores I18n provides out-of-the-box TypeScript support for translations and allows for flexible variable translations based on factors like screen size.

Features

  • Tiny and flexible: Nano Stores I18n is a small and flexible JavaScript library.
  • Compatible with multiple frameworks: It works with React, Preact, Vue, Svelte, and plain JS.
  • Zero dependencies: Nano Stores I18n has no external dependencies.
  • Supports tree-shaking: It allows for efficient tree-shaking to optimize the size of the bundled code.
  • Translation on-demand download: Nano Stores I18n supports on-demand downloading of translations.
  • Plain flat JSON translations: Translations are kept in a plain flat JSON structure, making it compatible with online translation services.
  • Out-of-the-box TypeScript support: Nano Stores I18n provides TypeScript support for translations without any additional configuration.
  • Flexible variable translations: You can change translations based on variables such as screen size.

Installation

To install Nano Stores I18n, you can use npm or yarn. Open your terminal and run the following command:

npm install nano-stores-i18n

or

yarn add nano-stores-i18n

After installation, you can import Nano Stores I18n into your project:

import NanoStoresI18n from 'nano-stores-i18n';

For more details on how to use Nano Stores I18n, please refer to the official Nano Stores documentation.

Summary

Nano Stores I18n is a lightweight and flexible JavaScript library for making web applications translatable. It offers features such as compatibility with popular frameworks, zero dependencies, tree-shaking support, on-demand translation downloading, plain JSON translations, TypeScript support, and flexible variable translations. With its small size and easy integration, Nano Stores I18n is a suitable choice for developers who need translation capabilities in their web applications.