Skip to content

vue-i18n / general / TranslateOptions

Interface: TranslateOptions<Locales> ​

Translate Options

Remarks ​

Options for Translation API

Vue I18n General ​

Extends ​

  • LocaleOptions<Locales>

Type Parameters ​

Type ParameterDefault type
LocalesLocale

Properties ​

default? ​

ts
optional default: string | boolean;

Remarks ​

Default message when is occurred translation missing


escapeParameter? ​

ts
optional escapeParameter: boolean;

Remarks ​

Whether to escape parameters for list or named interpolation values. When enabled, this option:

  • Escapes HTML special characters (<, >, ", ', &, /, =) in interpolation parameters
  • Sanitizes the final translated HTML to prevent XSS attacks by:
    • Escaping dangerous characters in HTML attribute values
    • Neutralizing event handler attributes (onclick, onerror, etc.)
    • Disabling javascript: URLs in href, src, action, formaction, and style attributes

Default Value ​

ts
false

See ​

HTML Message - Using the escapeParameter option


fallbackWarn? ​

ts
optional fallbackWarn: boolean;

Remarks ​

Whether do template interpolation on translation keys when your language lacks a translation for a key


list? ​

ts
optional list: unknown[];

Remarks ​

List interpolation


locale? ​

ts
optional locale: LocaleDetector<any[]> | Locales;

Remarks ​

The locale of localization

Inherited from ​

ts
LocaleOptions.locale

missingWarn? ​

ts
optional missingWarn: boolean;

Remarks ​

Whether suppress warnings outputted when localization fails


named? ​

ts
optional named: Record<string, unknown>;

Remarks ​

Named interpolation


plural? ​

ts
optional plural: number;

Remarks ​

Plulralzation choice number


resolvedMessage? ​

ts
optional resolvedMessage: boolean;

Remarks ​

Whether the message has been resolved

Released under the MIT License.