Options

Lazy Loading

Lazy loading options.

lazy

  • type: boolean or LazyOptions
  • default: false

See also Lazy-load translations.

Whether the translations should be lazy-loaded. If this is enabled, locales must be an array of objects, each containing a file or files key.

Loading locale messages lazily means that only messages for currently used locale (and for the fallback locale, if different from current locale) will be loaded on page loading.

langDir

  • type: string
  • default: locales

A relative path to a directory containing translation files to load. Can be used with or without lazy-loading (the lazy option).

The path is resolved relative to the project restructureDir at the root of a project ('i18n' by default).

Absolute paths will fail in production (eg. /locales should be changed into either locales or ./locales)

Copyright © 2024