Closed Bug 1642423 Opened 4 years ago Closed 4 years ago

document.l10n.formatValues should accept strings as well as L10nKeys

Categories

(Core :: Internationalization, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: mossop, Assigned: mossop)

References

Details

Attachments

(1 file)

Formatting multiple values is pretty verbose in the common case:

await document.l10n.formatValues([
  { id: "value1" },
  { id: "value2" },
  { id: "value3" },
]);

If instead elements of the array could optionally be strings it could be simpler:

await document.l10n.formatValues([
  "value1",
  "value2",
  "value3",
]);
Blocks: 1642398
Component: Localization → Internationalization
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Severity: -- → S3
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b5928fd85e5
document.l10n.formatValues should accept simple strings as well as L10nKeys. r=zbraniecki
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/329f82b99110
document.l10n.formatValues should accept simple strings as well as L10nKeys. r=zbraniecki
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Flags: needinfo?(dtownsend)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: