Skip to content

Using formatMessage in a loop construct #83

Open
@vcatalano

Description

@vcatalano

There doesn't appear to be a way to use the formatMessage directive in a loop construct with messages containing variable numbers of arguments. For example, I have an array containing messages, however, each message does not take the same arguments:

{{#messages}}
  {{formatMessage (intlGet messageText)
      num=??
      ago=??}}
{{/messages}}
var messages = [
  { messageText: "Welcome, {user}!" },
  { messageText: "How are you today, {firstName} {lastName}?" }
];

Is it possible to handle dynamic arguments with the formatMessage directive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions