Skip to content

formatValues should handle a list of IDs #180

@zbraniecki

Description

@zbraniecki

At the moment, formatValues requires to pass an array of arrays of [id, attrs], but quite often the attrs are not needed and the additional array is not necessary.

it would be nice if instead of:

      let [title, message, okButton, cancelButton] = await document.l10n.formatValues([
        ["containers-remove-alert-title"],
        ["containers-remove-alert-msg"],
        ["containers-remove-ok-button"],
        ["containers-remove-cancel-button"]
      ]);

one could write:

      let [title, message, okButton, cancelButton] = await document.l10n.formatValues([
        "containers-remove-alert-title",
        "containers-remove-alert-msg",
        "containers-remove-ok-button",
        "containers-remove-cancel-button"
      ]);

but if we decide not to support it, it would at least be helpful to throw when attempting to pass a string. (but then, if we're already detecting that... how about make it work for our friend, the developer?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions