Options
All
  • Public
  • Public/Protected
  • All
Menu

@fluent/bundle - v0.16.0

Index

Type aliases

ComplexPattern

ComplexPattern: Array<PatternElement>

Expression

FluentFunction

FluentFunction: function

Type declaration

FluentValue

FluentValue: FluentType<unknown> | string

FluentVariable

FluentVariable: FluentValue | NativeValue

FunctionReference

FunctionReference: object

Type declaration

Literal

Message

Message: object

Type declaration

MessageReference

MessageReference: object

Type declaration

NamedArgument

NamedArgument: object

Type declaration

NumberLiteral

NumberLiteral: object

Type declaration

Pattern

Pattern: string | ComplexPattern

PatternElement

PatternElement: string | Expression

SelectExpression

SelectExpression: object

Type declaration

StringLiteral

StringLiteral: object

Type declaration

Term

Term: object

Type declaration

TermReference

TermReference: object

Type declaration

TextTransform

TextTransform: function

Type declaration

    • (text: string): string
    • Parameters

      • text: string

      Returns string

VariableReference

VariableReference: object

Type declaration

Variant

Variant: object

Type declaration

Functions

DATETIME

  • The implementation of the DATETIME() builtin available to translations.

    Translations may call the DATETIME() builtin in order to specify formatting options of a number. For example:

    now = It's {DATETIME($today, month: "long")}.

    The implementation expects an array of FluentValues representing the positional arguments, and an object of named FluentValues representing the named parameters.

    The following options are recognized:

    dateStyle
    timeStyle
    fractionalSecondDigits
    dayPeriod
    hour12
    weekday
    era
    year
    month
    day
    hour
    minute
    second
    timeZoneName

    Other options are ignored.

    Parameters

    • args: Array<FluentValue>

      The positional arguments passed to this DATETIME().

    • opts: Record<string, FluentValue>

      The named argments passed to this DATETIME().

    Returns FluentValue

NUMBER

  • The implementation of the NUMBER() builtin available to translations.

    Translations may call the NUMBER() builtin in order to specify formatting options of a number. For example:

    pi = The value of π is {NUMBER($pi, maximumFractionDigits: 2)}.

    The implementation expects an array of FluentValues representing the positional arguments, and an object of named FluentValues representing the named parameters.

    The following options are recognized:

    unitDisplay
    currencyDisplay
    useGrouping
    minimumIntegerDigits
    minimumFractionDigits
    maximumFractionDigits
    minimumSignificantDigits
    maximumSignificantDigits

    Other options are ignored.

    Parameters

    • args: Array<FluentValue>

      The positional arguments passed to this NUMBER().

    • opts: Record<string, FluentValue>

      The named argments passed to this NUMBER().

    Returns FluentValue

resolveComplexPattern