@ecsbase/i18n
v0.2.0
Published
@ecsbase/i18n — reusable building block.
Downloads
139
Readme
@ecsbase/i18n
Signal-based translation store. Brand-agnostic and safe in Node.
Install
pnpm add @ecsbase/i18nPeer dependencies
@angular/core^20.0.0
Quick start
import { createTranslationStore } from '@ecsbase/i18n';
const store = createTranslationStore({
defaultLocale: 'en',
dictionaries: { en: { hello: 'Hello' }, fr: { hello: 'Bonjour' } },
});
store.setLocale('fr');
store.t('hello'); // → 'Bonjour'Playground
Live demo: /i18n — run pnpm start:playground then visit http://localhost:4200/i18n.
License
MIT — see LICENSE at the repository root.
