# Internationalization (intl) Hooks

This suite of hooks provides a standardized way to handle internationalization across components while respecting module boundaries. The system allows:

1. **Root Module Configuration** - Set default intl keys/namespaces at application root
2. **Component-Level Overrides** - Customize translations per-component via `intlKey`/`intlNS` props
3. **Automatic Key Resolution** - Components automatically find translations without hardcoded paths

## Key Components

1. **[useIntlKeyStore](./useIntlKeyStore/README.md)** - Global store for managing intl keys
2. **[useIntlKey](./useIntlKey/README.md)** - Hook for resolving intl keys
3. **[useKintIntl](./useKintIntl/README.md)** - Enhanced intl formatting hook

## Core Principles

- **No Library Translations** - Parent modules provide all translations
- **Explicit Key Management** - Required key configuration prevents silent failures
- **Namespace Isolation** - Prevents key collisions between modules
- **Override Support** - Components can bypass default keys when needed

## Implementation Benefits

- ✅ Avoids duplicated translation efforts
- ✅ Maintains Lokalise compatibility
- ✅ Enables component reuse across modules
- ✅ Provides clear error messaging for missing config
- ✅ Supports both simple and complex i18n scenarios

## Developer note
This clearly isn't an ideal solution, but it is the best one we could come up with at the time. Each module implementing kint-components can either set up a global key store telling kint-components where to look for their intl keys in general, or set this on a component by component case via the `intlKey` and `intlNS` props used throughout kint-components