# Capability Spec: react-i18n **Package**: `@suaveplan/react-i18n` **Status**: PROPOSED > Every requirement carries a `**Verified by:**` line at authoring time. (See `openspec/AGENTS.md` Section 13.) ## ADDED Requirements ### Requirement: TranslationProvider mounts an I18nInstance The package SHALL expose `TranslationProvider` that mounts and exposes an `I18nInstance` from `@suaveplan/i18n` to descendants via React context. The Provider SHALL accept either `i18n: I18nInstance` (caller-managed; Provider does NOT dispose) or `config: I18nConfig` (Provider-managed; calls `createI18n(config)` on mount and `i18n.dispose()` on unmount). It SHALL connect the instance event bus to React state via `useSyncExternalStore` so any subscribed hook re-renders on `languageChanged` / `loaded`. #### Scenario: caller-managed instance is not disposed on unmount - **GIVEN** an externally created `I18nInstance` passed via `i18n` prop - **WHEN** the Provider unmounts - **THEN** the instance's `dispose()` was NOT called #### Scenario: provider-managed instance is disposed on unmount - **GIVEN** a Provider mounted with `config={...}` - **WHEN** the Provider unmounts - **THEN** the internally-created instance's `dispose()` was called exactly once #### Scenario: SSR initial messages hydrate without round-trip - **GIVEN** server-rendered HTML with embedded `