i18n-feater
v1.0.4
Published
Lightweight instance-based i18n for TypeScript.
Downloads
462
Maintainers
Readme
i18n-feater
A lightweight, type-safe i18n library for TypeScript.
Provides simple locale state management with automatic fallback handling.
Features
- TypeScript-first
- Locale state management
- Automatic fallback locale resolution
- Supports function-based messages (parameterized translations)
- Works in both Node.js and browser environments
- Zero dependencies
Installation
npm i i18n-featerBasic Usage
const i18n = I18N({
fallbackLocale: Locale.EN,
messages: {
en: {
hello: "Hello",
welcome: name => `Welcome, ${name}`
},
ko: {
hello: "안녕하세요"
}
}
});
i18n.setLocale(Locale.KO);
console.log(i18n.t("hello"));
console.log(i18n.t("welcome", "Tom"))