Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ILocaleNodeMapCompilerOptions

Hierarchy

  • Pick<INodeCompilerOptions, "otherSelectCaseKey" | "indexVarName" | "provideArgumentVarName" | "onFunctionUsed" | "onSelectUsed" | "onRuntimeMethodUsed">
    • ILocaleNodeMapCompilerOptions

Index

Properties

Optional defaultLocale

defaultLocale: string

The default locale from locales. If omitted then an empty fragment would be returned if an unsupported locale is passed to a message function.

Optional defaultLocaleSrc

defaultLocaleSrc: string

The name of the variable that holds the default locale or a source code of a literal default locale string. By default, the serialized defaultLocale is used.

indexVarName

indexVarName: string

The name of the temporary variable used by plural, select and selectordinal to store the detected index.

localeVarName

localeVarName: string

The name of the variable that holds the locale passed to the message function.

locales

locales: string[]

The list of all supported locales stored in localesVarName.

The attentive reader might ask why not use the keys from the localeNodeMap. The reason is to preserve the same order of locales between different messages.

localesVarName

localesVarName: string

The name of the variable that holds an array of locales supported by the message.

Optional otherSelectCaseKey

otherSelectCaseKey: string

The key that is used as the default for select.

default

"other"

Methods

Optional onFunctionUsed

Optional onRuntimeMethodUsed

  • onRuntimeMethodUsed(runtimeMethod: RuntimeMethod, indexVarUsed: boolean): void
  • Triggered if a runtime method usage was rendered.

    Parameters

    • runtimeMethod: RuntimeMethod

      The name of the used runtime method.

    • indexVarUsed: boolean

      true if the method used an index var to store temporary runtime result.

    Returns void

Optional onSelectUsed

provideArgumentVarName

  • provideArgumentVarName(argumentName: string): string

Generated using TypeDoc