Commit graph

3 commits

Author SHA1 Message Date
Snider
0955847661 refactor(i18n): move Message struct to interface.go
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:59:33 +00:00
Snider
1477bceb95 refactor(i18n): consolidate interfaces in interface.go
Move MissingKeyHandler, MissingKey, MissingKeyAction, and PluralRule
function types to interface.go for better discoverability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:57:57 +00:00
Snider
829be45fcc feat(i18n): add remaining API features for stability
Implements the final features from the semantic i18n plan:

- Template caching: sync.Map cache for compiled templates
- Translator interface: enables mocking for tests
- Custom intent registration: thread-safe RegisterIntents(), UnregisterIntent()
- JSON-based grammar: verb/noun forms in locale files, checked before computed
- Fallback chain: T() tries common.action.{verb} and common.{verb}
- CLI enhancements: Timeout(), Filter(), Multi() options, ChooseMulti()
- Intent key constants: type-safe IntentCore* and Key* constants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:11:58 +00:00