@duckalization/runtime
v0.1.0
Published
Tiny framework-agnostic runtime for content-addressed i18n: lookup, fallback, plurals, interpolation.
Maintainers
Readme
@duckalization/runtime
Catalog lookup, source-locale fallback, Intl.PluralRules, {name}
interpolation, and TypeScript placeholder checking. No React.
React apps should install @duckalization/react
instead; it re-exports createDuck.
pnpm add @duckalization/runtimeimport { createDuck } from '@duckalization/runtime';
import es from '../locales/es.json'; // written by duckalize extract / apply
const duck = createDuck({ sourceLocale: 'en' });
export const { __ } = duck; // bare identifier; duckalize extract scans for this
duck.load('es', es);
duck.setLocale('es');
__('Welcome back, {name}', { name: 'Ada' });Missing translations fall back to the inline source text.
Complete usage guide: duckalization README.
Agents: llms.txt.
