Docs / Infrastructure
SenseI18nService
Signal-based internationalisation for @artificialsenselabs/ui โ built-in EN/DE/ES/FR bundles, runtime overrides, and RTL direction.
Overview
Category: Infrastructure. Import: import { SenseI18nService, AS_FR } from '@artificialsenselabs/ui';
const i18n = inject(SenseI18nService);
const label = i18n.translate('select.clear');
i18n.setBundle(AS_FR, 'fr');
i18n.extend({ 'custom.key': 'Override' });API
| Member | Description |
|---|---|
translate(key, params?) | Resolve a key with optional {placeholder} interpolation. |
setBundle(bundle, locale) | Swap locale pack; merges over English so missing keys still render. |
extend(partial) | Merge ad-hoc keys into the active bundle. |
locale / dir | Active BCP 47 tag and computed ltr | rtl direction. |
Built-in bundles
AS_EN,AS_DE,AS_ES,AS_FRโ canonical key parity enforced in CI.- Typed keys via
SenseTranslationKey(derived fromen.ts). - Machine gate:
pnpm run check:i18nblocks hardcoded ARIA/label strings inlibs/ui.