refactor: migrate locale/RTL to @vuetify/v0#22753
Open
johnleider wants to merge 16 commits intonextfrom
Open
Conversation
Design for migrating Vuetify's locale/RTL system to use @vuetify/v0 composables as the runtime baseline. Bumps v0 to ^0.1.7 for RTL support.
Updated spec to retain provideLocale() as thin wrapper. Plan covers 4 tasks: core composable rewrite, vue-i18n adapter update, type exports, and integration verification.
Vuetify's locale composable now delegates to @vuetify/v0 for: - Message storage (tokens) and translation (t()) - Number formatting (n()) - Fallback locale resolution - RTL boolean state Vuetify remains responsible for: - $vuetify. prefix stripping - Per-locale RTL map (ar, fa, he → true) - CSS class generation (v-locale--is-rtl/ltr) - LocaleSymbol provide/inject contract BREAKING CHANGE: LocaleInstance.provide() and .name removed. LocaleInstance.fallback and .messages removed from public type. Nested contexts use provideLocale() or VLocaleProvider.
Includes runtime locale/theme registration support via
register({ id, messages }) and exported flatten() utility.
This was referenced Mar 24, 2026
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
Fixed |
KaelWD
reviewed
Apr 2, 2026
KaelWD
reviewed
Apr 9, 2026
| name: string | ||
| fallback: Ref<string> | ||
| messages: Ref<LocaleMessages> | ||
| provide: (props: LocaleOptions) => VueI18nLocaleInstance |
Member
There was a problem hiding this comment.
Why were name and provide removed on LocaleInstance but not here?
KaelWD
reviewed
Apr 9, 2026
|
|
||
| if (!parent) throw new Error('[Vuetify] Could not find injected locale instance') | ||
|
|
||
| if ('provide' in parent && isFunction(parent.provide)) { |
Member
There was a problem hiding this comment.
Especially when you're still using provide.
KaelWD
reviewed
Apr 9, 2026
| export interface LocaleInstance { | ||
| name: string | ||
| decimalSeparator: ShallowRef<string> | ||
| messages: Ref<LocaleMessages> |
Member
There was a problem hiding this comment.
No idea if anyone actually did this but it used to be possible to add to messages at runtime, now they all have to be declared upfront.
KaelWD
reviewed
Apr 9, 2026
| const locale = createLocaleInstance(v0Locale, props) | ||
| const rtl = provideRtl(locale, parent.rtl, props) | ||
|
|
||
| const data = { ...locale, ...rtl, _messages: messages, _fallback: fallback } satisfies FullLocaleInstance |
Member
There was a problem hiding this comment.
Any particular reason to "remove" messages and fallback if they're just being renamed and made private?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@vuetify/v0'screateLocale()for message storage (tokens), translation (t()), number formatting (n()), and fallback resolutioncreateRtl(), bridged via per-locale RTL mappackages/vuetify/src/locale/adapters/vuetify.ts— v0'sVuetify0LocaleAdapterhandles this$vuetify.prefix stripping, per-locale RTL map, CSS class generation,LocaleSymbolDIt,n,current,isRtl,rtlClasses,decimalSeparator) is unchangedBreaking Changes
LocaleInstance.provide()and.nameremovedLocaleInstance.fallbackand.messagesremoved from public typeprovideLocale()orVLocaleProviderTest plan
pnpm build:lib— 551 files compiledtsgo -p tsconfig.checks.json --noEmit— cleaneslint src --max-warnings 0— cleanpnpm test:unit -- --run— 661 passed (4 pre-existing failures in date.spec.ts unrelated)VLocaleProviderscoped locale override in browser