Skip to content

Latest commit

 

History

History
75 lines (40 loc) · 2.09 KB

6.misc.md

File metadata and controls

75 lines (40 loc) · 2.09 KB

Misc

Miscellaneous options.


experimental

  • type: object
  • default: { jsTsFormatResource: false }

Configure the flag for experimental features of the nuxt i18n module.

::alert{type="info"}

This module option setting is also set to the runtime config.

::

Supported properties:

  • jsTsFormatResource (default: false) - Allow the format js and ts for locale messages in lazy load translation.

precompile

  • type: object
  • default: { strictMessage: true, escapeHtml: false }

Configure flags that sets the behavior precompilation of locale messages.

Supported properties:

  • strictMessage (default: true) Strictly check that the locale message does not contain HTML tags. If HTML tags are included, an error is thrown. ::alert{type="warning"}

    If you do not want the error to be thrown, you can work around it by setting it to false. However, this means that the locale message might cause security issues with XSS. In that case, we recommend setting the escapeHtml option to true.

    ::

  • escapeHtml (default: false) - Determine whether to escape HTML tags if they are included in the locale message. ::alert{type="warning"}

    If strictMessage is disabled by setting it to false, we recommend enabling this option.

    ::

types

  • type: string (composition or legacy) | undefined
  • default: undefined

Enforces the type definition of the API style to be used. if you set compostion, Composition API types provided by Vue I18n and @nuxtjs/i18n are supported, else legacy, Options API types are supported. If you are running a dev server with nuxi dev, watching the Nuxt configuration will switch the type.

::alert{type="warning"}

If it can not detect Nuxt configuration changing, you need to run nuxi prepare.

::

debug

  • type: boolean
  • default: false

Whether to use @nuxtjs/i18n debug mode. If true, logs will be output to the console.

::alert{type="warning"}

The purpose of this option is to help identify any problems with @nuxtjs/i18n.

Don't enable this option for use in production. Performance will be decreased.

::