Skip to content

vue-i18n / vue / ComponentCustomProperties

Interface: ComponentCustomProperties

Vue I18n Injection

Component Custom Properties for Vue I18n

Methods

$d()

Call Signature

ts
$d(value): string;

Datetime formatting

Parameters
ParameterTypeDescription
valuestring | number | DateA value, timestamp number or Date instance
Returns

string

formatted value

Remarks

If this is used in a reactive context, it will re-evaluate once the locale changes.

In I18nMode | Composition API mode, the $d is injected by app.config.globalProperties. the input / output is the same as for Composer instance, and it work on global scope. About that details, see Composer#d | `Composer#d`.

Call Signature

ts
$d<Value, Key, DefinedDateTimeFormat, Keys, ResourceKeys>(value, key): string;

Datetime formatting

Type Parameters
Type ParameterDefault type
Value extends string | number | Datenumber
Key extends stringstring
DefinedDateTimeFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedDateTimeFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedDateTimeFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
valueValueA value, timestamp number or Date instance
keyKey | ResourceKeysA key of datetime formats
Returns

string

formatted value

Remarks

Overloaded $d. About details, see the $d remarks.

Call Signature

ts
$d<Value, Key, DefinedDateTimeFormat, Keys, ResourceKeys>(value, options): string;

Datetime formatting

Type Parameters
Type ParameterDefault type
Value extends string | number | Datenumber
Key extends stringstring
DefinedDateTimeFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedDateTimeFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedDateTimeFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
valueValueA value, timestamp number or Date instance
optionsDateTimeOptions<Key | ResourceKeys>An options
Returns

string

formatted value

Remarks

Overloaded $d. About details, see the $d remarks.

Call Signature

ts
$d<Value, Key, DefinedDateTimeFormat, Keys, ResourceKeys>(
   value, 
   key, 
   locale): string;

Datetime formatting

Type Parameters
Type ParameterDefault type
Value extends string | number | Datenumber
Key extends stringstring
DefinedDateTimeFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedDateTimeFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedDateTimeFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
valueValueA value, timestamp number or Date instance
keyKey | ResourceKeysA key of datetime formats
localestringA locale, optional, override locale that global scope or local scope
Returns

string

formatted value

Remarks

Overloaded $d. About details, see the $d remarks.

Call Signature

ts
$d<Value, Key, DefinedDateTimeFormat, Keys, ResourceKeys, OptionsType>(
   value, 
   options, 
   locale): IsPart<OptionsType> extends true ? DateTimeFormatPart[] : string;

Datetime formatting

Type Parameters
Type ParameterDefault type
Value extends number | Datenumber
Key extends stringstring
DefinedDateTimeFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedDateTimeFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedDateTimeFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
OptionsTypeDateTimeOptions<Key | ResourceKeys, string>
Parameters
ParameterTypeDescription
valueValueA value, timestamp number or Date instance
optionsOptionsTypeAn options
localestringA locale, optional, override locale that global scope or local scope
Returns

IsPart<OptionsType> extends true ? DateTimeFormatPart[] : string

formatted value

Remarks

Overloaded $d. About details, see the $d remarks.


$n()

Call Signature

ts
$n(value): string;

Number formatting

Parameters
ParameterTypeDescription
valuenumberA number value
Returns

string

formatted value

Remarks

If this is used in a reactive context, it will re-evaluate once the locale changes.

In I18nMode | Composition API mode, the $n is injected by app.config.globalProperties. the input / output is the same as for Composer instance, and it work on global scope. About that details, see Composer#n | `Composer.n`.

Call Signature

ts
$n<Key, DefinedNumberFormat, Keys, ResourceKeys>(value, key): string;

Number formatting

Type Parameters
Type ParameterDefault type
Key extends stringstring
DefinedNumberFormat extends RemoveIndexSignature<{ [key: string]: NumberFormatOptions; }>RemoveIndexSignature<{ [key: string]: NumberFormatOptions; }>
KeysIsEmptyObject<DefinedNumberFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedNumberFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
valuenumberA number value
keyKey | ResourceKeysA key of number formats
Returns

string

formatted value

Remarks

Overloaded $n. About details, see the $n remarks.

Call Signature

ts
$n<Key, DefinedNumberFormat, Keys, ResourceKeys, OptionsType>(value, options): IsPart<OptionsType> extends true ? NumberFormatPart[] : string;

Number formatting

Type Parameters
Type ParameterDefault type
Key extends stringstring
DefinedNumberFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedNumberFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedNumberFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
OptionsTypeNumberOptions<Key | ResourceKeys, string>
Parameters
ParameterTypeDescription
valuenumberA number value
optionsOptionsTypeAn options, see the NumberOptions
Returns

IsPart<OptionsType> extends true ? NumberFormatPart[] : string

formatted value

Remarks

Overloaded $n. About details, see the $n remarks.

Call Signature

ts
$n<Key, DefinedNumberFormat, Keys, ResourceKeys>(
   value, 
   key, 
   locale): string;

Number formatting

Type Parameters
Type ParameterDefault type
Key extends stringstring
DefinedNumberFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedNumberFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedNumberFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
valuenumberA number value
keyKey | ResourceKeysA key of number formats
localestringA locale, optional, override locale that global scope or local scope
Returns

string

formatted value

Remarks

Overloaded $n. About details, see the $n remarks.

Call Signature

ts
$n<Key, DefinedNumberFormat, Keys, ResourceKeys, OptionsType>(
   value, 
   options, 
   locale): IsPart<OptionsType> extends true ? NumberFormatPart[] : string;

Number formatting

Type Parameters
Type ParameterDefault type
Key extends stringstring
DefinedNumberFormat extends RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>RemoveIndexSignature<{ [key: string]: DateTimeFormatOptions; }>
KeysIsEmptyObject<DefinedNumberFormat> extends false ? PickupFormatPathKeys<{ [K in string | number | symbol]: DefinedNumberFormat[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
OptionsTypeNumberOptions<Key | ResourceKeys, string>
Parameters
ParameterTypeDescription
valuenumberA number value
optionsOptionsTypeAn options, see the NumberOptions
localestringA locale, optional, override locale that global scope or local scope
Returns

IsPart<OptionsType> extends true ? NumberFormatPart[] : string

formatted value

Remarks

Overloaded $n. About details, see the $n remarks.


$rt()

Call Signature

ts
$rt(message): string;

Resolve locale message translation

Parameters
ParameterTypeDescription
message| VueMessageType | MessageFunction<VueMessageType>A target locale message to be resolved. You will need to specify the locale message returned by $tm.
Returns

string

translated message

Remarks

If this is used in a reactive context, it will re-evaluate once the locale changes.

In I18nMode | Composition API mode, the $rt is injected by app.config.globalProperties. the input / output is the same as for Composer, and it work on global scope. About that details, see Composer#rt | `Composer#rt`.

Call Signature

ts
$rt(
   message, 
   plural, 
   options?): string;

Resolve locale message translation for plurals

Parameters
ParameterTypeDescription
message| VueMessageType | MessageFunction<VueMessageType>A target locale message to be resolved. You will need to specify the locale message returned by $tm.
pluralnumberWhich plural string to get. 1 returns the first one.
options?TranslateOptions<string>Additional options for translation
Returns

string

Translated message

Remarks

Overloaded $rt. About details, see the $rt remarks.

Call Signature

ts
$rt(
   message, 
   list, 
   options?): string;

Resolve locale message translation for list interpolations

Parameters
ParameterTypeDescription
message| VueMessageType | MessageFunction<VueMessageType>A target locale message to be resolved. You will need to specify the locale message returned by $tm.
listunknown[]A values of list interpolation.
options?TranslateOptions<string>Additional options for translation
Returns

string

Translated message

Remarks

Overloaded $rt. About details, see the $rt remarks.

Call Signature

ts
$rt(
   message, 
   named, 
   options?): string;

Resolve locale message translation for named interpolations

Parameters
ParameterTypeDescription
message| VueMessageType | MessageFunction<VueMessageType>A target locale message to be resolved. You will need to specify the locale message returned by $tm.
namedNamedValueA values of named interpolation.
options?TranslateOptions<string>Additional options for translation
Returns

string

Translated message

Remarks

Overloaded $rt. About details, see the $rt remarks.


$t()

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
Returns

string

translation message

Remarks

If this is used in a reactive context, it will re-evaluate once the locale changes.

In I18nMode | Composition API mode, the $t is injected by app.config.globalProperties. the input / output is the same as for Composer, and it work on global scope. About that details, see Composer#t | `Composer#t`.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key, plural): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
pluralnumberA choice number of plural
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   plural, 
   options): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
pluralnumberWhich plural string to get. 1 returns the first one.
optionsTranslateOptionsAn options, see the TranslateOptions
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key, defaultMsg): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
defaultMsgstringA default message to return if no translation was found
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   defaultMsg, 
   options): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
defaultMsgstringA default message to return if no translation was found
optionsTranslateOptionsAn options, see the TranslateOptions
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key, list): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
listunknown[]A values of list interpolation
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   list, 
   plural): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
listunknown[]A values of list interpolation
pluralnumberA choice number of plural
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   list, 
   defaultMsg): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
listunknown[]A values of list interpolation
defaultMsgstringA default message to return if no translation was found
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   list, 
   options): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
listunknown[]A values of list interpolation
optionsTranslateOptionsAn options, see the TranslateOptions
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key, named): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
namedNamedValueA values of named interpolation
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   named, 
   plural): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
namedNamedValueA values of named interpolation
pluralnumberA choice number of plural
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   named, 
   defaultMsg): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
namedNamedValueA values of named interpolation
defaultMsgstringA default message to return if no translation was found
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.

Call Signature

ts
$t<Key, DefinedLocaleMessage, Keys, ResourceKeys>(
   key, 
   named, 
   options): string;

Locale message translation

Type Parameters
Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never
Parameters
ParameterTypeDescription
keynumber | Key | ResourceKeysA target locale message key
namedNamedValueA values of named interpolation
optionsTranslateOptionsAn options, see the TranslateOptions
Returns

string

translation message

Remarks

Overloaded $t. About details, see the $t remarks.


$te()

ts
$te<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key, locale?): boolean;

Translation message exist

Type Parameters

Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never

Parameters

ParameterTypeDescription
keyKey | ResourceKeysA target locale message key
locale?stringA locale, optional, override locale that global scope or local scope

Returns

boolean

If found locale message, true, else false, Note that false is returned even if the value present in the key is not translatable.

Remarks

About that details, see VueI18n#te | `VueI18n#te` or Composer#te | `Composer#te`.


$tm()

ts
$tm<Key, DefinedLocaleMessage, Keys, ResourceKeys>(key): 
  | {
}
| LocaleMessageValue<VueMessageType>;

Locale messages getter

Type Parameters

Type ParameterDefault type
Key extends string-
DefinedLocaleMessage extends RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>RemoveIndexSignature<{ [key: string]: LocaleMessageValue<VueMessageType>; }>
KeysIsEmptyObject<DefinedLocaleMessage> extends false ? JsonPaths<{ [K in string | number | symbol]: DefinedLocaleMessage[K] }> : never
ResourceKeysIsNever<Keys> extends false ? Keys : never

Parameters

ParameterTypeDescription
keyKey | ResourceKeysA target locale message key

Returns

| { } | LocaleMessageValue<VueMessageType>

locale messages

Remarks

In I18nMode | Composition API mode, the $tm is injected by app.config.globalProperties. the input / output is the same as for Composer instance, and it work on global scope. About that details, see Composer#tm | `Composer.tm`. Based on the current locale, locale messages will be returned from Composer instance messages. If you change the locale, the locale messages returned will also correspond to the locale. If there are no locale messages for the given key in the composer instance messages, they will be returned with fallbacking.

Properties

$i18n

ts
$i18n: ExportedGlobalComposer;

Exported Global Composer instance

Remarks

You can get the exported composer instance which are exported from global Composer | composer instance created with createI18n You can get the exported composer instance in I18nMode | Composition API mode The locales, locale messages, and other resources managed by the instance referenced by this property are valid as global scope. If the i18n component custom option is not specified, it's the same as the VueI18n instance that can be referenced by the i18n instance I18n.global | global property.

Released under the MIT License.