Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • I18nOptions

Index

Properties

defaultLocale

defaultLocale: string

Set default locale. This locale will be used when fallback is enabled and the translation doesn't exist in a particular locale. Defaults to en.

defaultSeparator

defaultSeparator: string

Set the default string separator. Defaults to ., as in scope.translation.

enableFallback

enableFallback: boolean

Set if engine should fallback to the default locale when a translation is missing. Defaults to false.

When enabled, missing translations will first be looked for in less specific versions of the requested locale and if that fails by taking them from your I18n#defaultLocale.

locale

locale: string

Set the current locale. Defaults to en.

missingBehavior

missingBehavior: MissingBehavior

Set missing translation behavior.

  • message will display a message that the translation is missing.
  • guess will try to guess the string.
  • error will raise an exception whenever a translation is not defined.

See MissingTranslation.register for instructions on how to define your own behavior.

missingPlaceholder

missingPlaceholder: MissingPlaceholderHandler

Return a missing placeholder message for given parameters.

missingTranslationPrefix

missingTranslationPrefix: string

If you use missingBehavior with 'message', but want to know that the string is actually missing for testing purposes, you can prefix the guessed string by setting the value here. By default, no prefix is used.

nullPlaceholder

nullPlaceholder: NullPlaceholderHandler

Return a placeholder message for null values. Defaults to the same behavior as I18n.missingPlaceholder.

placeholder

placeholder: RegExp

Set the placeholder format. Accepts {{placeholder}} and %{placeholder}.

transformKey

transformKey: (key: string) => string

Transform keys. By default, it returns the key as it is, but allows for overriding. For instance, you can set a function to receive the camelcase key, and convert it to snake case.

Type declaration

    • (key: string): string
    • Parameters

      • key: string

      Returns string

Generated using TypeDoc