Hooks

VIntl for Nuxt binds VIntl events to Nuxt's hook system.

Build hooks

vintl:extendOptions(options)

Kind: async

Parameters:

  • options (InputModuleOptions) — mutable input options.

Called before VIntl for Nuxt options are validated. Useful to dynamically modify the configuration (e.g. automatically search files).

Runtime hooks

i18n:automatic(ctx)

Kind: sync

Parameters:

  • ctx (EventContext<AutomaticStateChangeEvent>) — an object containing the controller and the event.

Called whenever automatic mode is switched on or off.

More about this event

i18n:beforeLocaleChange(ctx)

Kind: sync

Parameters:

  • ctx (EventContext<LocaleChangeEvent>) — an object containing the controller and the event.

Called before the locale change and load.

More about this event

i18n:extendLocale(ctx)

Kind: async

Parameters:

  • ctx (EventContext<LocaleLoadEvent>) — an object containing the controller and the event.

Called during locale load and allows to load additional messages and resources for locale.

More about this event

i18n:afterLocaleChange(ctx)

Kind: sync

Parameters:

  • ctx (EventContext<AfterLocaleChangeEvent>) — an object containing the controller and the event.

Called after the locale has been applied.

More about this event

i18n:error(ctx)

Kind: sync

Parameters:

  • ctx (EventContext<ErrorEvent>) — an object containing the controller and the event.

Called when an error occurs in the controller or one of the listeners.

More about this event

i18n:ready(controller)

Kind: async

Parameters:

  • controller (IntlController<MessageValueType>) — the controller object that has just been set up.

Called when plugin setup is complete.