Published
Edited
Jun 1, 2020
Importers
FormatJS helpers
Insert cell
Insert cell
messageFormatter("section.title", "es").format({ placeholder: "grande" })
Insert cell
Insert cell
messageFormatter = function(key, lang, options = {}) {
let value;
try {
value = key.split('.').reduce((a, b) => a[b], translations[lang]);
} catch {}
if (!value && options.defaultValue) {
value = options.defaultValue;
}
return value ? new IntlMessageFormat.IntlMessageFormat(value, lang) : noop;
}
Insert cell
Insert cell
IntlMessageFormat = require('https://bundle.run/intl-messageformat@8.3.7')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more