i18n

@motioneffector/i18n

A lightweight, type-safe internationalization library with zero dependencies for modern web applications.

npm version license TypeScript

Features

Read the full manual →

Quick Start

import { createI18n } from '@motioneffector/i18n'

// Create i18n instance with translations
const i18n = createI18n({
  defaultLocale: 'en',
  translations: {
    en: {
      greeting: 'Hello, !',
      items: {
        one: '8 item',
        other: '8 items'
      }
    }
  }
})

// Interpolation
i18n.t('greeting', { name: 'World' })  // "Hello, World!"

// Pluralization
i18n.t('items', { count: 1 })  // "1 item"
i18n.t('items', { count: 5 })  // "5 items"

Testing & Validation

License

MIT © motioneffector