Skip to content

[Audit] useLocale - ensure parity with Vuetify createLocale #105

@johnleider

Description

@johnleider

Summary

Ensure useLocale has feature parity with Vuetify 3's createLocale.

Research Findings

v0 Architecture

  • Adapter Pattern: LocaleAdapter interface with pluggable implementations
  • Trinity Pattern: Full support via createLocaleContext()
  • RTL Support: Built-in RTL detection and handling
  • Message Interpolation: Template string interpolation for dynamic content

Current Status

v0's useLocale is largely feature-complete with Vuetify 3. Both provide:

  • Locale switching
  • Message retrieval with interpolation
  • RTL detection
  • Reactive locale state

Minor Alignment Items

Aspect v0 Vuetify 3 Action
API naming useLocale() useLocale() ✅ Aligned
RTL property ✅ Aligned
Message format Template interpolation Template interpolation ✅ Aligned
Adapter pattern ✅ Pluggable ❌ Built-in only v0 advantage

Tasks

  • Verify message interpolation syntax matches Vuetify 3
  • Ensure RTL detection logic is equivalent
  • Document any API differences
  • Test with Vuetify 3 locale message files

Files

  • v0: packages/0/src/composables/useLocale/index.ts
  • v0 adapter: packages/0/src/composables/useLocale/adapters/
  • Vuetify 3: packages/vuetify/src/composables/locale.ts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions