tiny-i18next
v1.0.4
Published
A lightweight translation module for modern Javascript
Downloads
2
Readme
i18n
This is a tiny and simple class for i18n translations. It supports placeholders and various plurals. It requires a modern browser or node 16.x or greater
Installation
Use npm, pnpm or yarn to install it.
pnpm add tiny-i18next
Use
import I18next from 'tiny-i18next';
const enTranslations = {
"cancel": "Cancel",
"checkout": "Checkout",
"modal_body": "This is the modal body",
"open": "Open",
"title": "Find"
}
const t = new I18next(enTranslations)
const t = new I18next({ name: "George" });
const userName = t('name') // George
See src/test/I18next.spec.ts for other examples