Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "src/methods/__mf"

Index

Variables

Functions

Variables

Const messageFormatInstanceForLocale

messageFormatInstanceForLocale: Record<string, MessageFormat>

Functions

__mf

  • __mf(phraseOrParams: string | TemplateStringsArray | I18nParams, ...values: any[]): string
  • Supports the advanced MessageFormat as provided by excellent messageformat module. You should definetly head over to messageformat.github.io for a guide to MessageFormat. i18n-for-browser takes care of new MessageFormat('en').compile(msg); with the current msg loaded from it's json files and cache that complied fn in memory. So in short you might use it similar to __() plus extra object to accomblish MessageFormat's formating.

    Parameters

    • phraseOrParams: string | TemplateStringsArray | I18nParams

      Phrase to translate or params.

    • Rest ...values: any[]

      Values to print.

    Returns string

    Translate.

Generated using TypeDoc