Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/vue-i18n-core/src/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ import { isLegacyVueI18n } from './utils'

export { DEFAULT_LOCALE } from '@intlify/core-base'

type FlattenKeys<T> = T extends object
? {
[K in keyof T & string]: K extends string
? T[K] extends object
? `${K}.${FlattenKeys<T[K]>}`
: K
: never;
}[keyof T & string]
: "";
// extend VNode interface
export const DEVTOOLS_META = '__INTLIFY_META__'

Expand Down Expand Up @@ -673,7 +682,7 @@ export interface ComposerTranslation<
*
* @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
*/
<Key extends string>(key: Key | ResourceKeys | number): string
<Key extends FlattenKeys<Messages[Locale]>>(key: Key | ResourceKeys | number): string
/**
* Locale message translation for plurals
*
Expand Down