UNPKG

@gooddata/react-components

Version:

GoodData.UI - A powerful JavaScript library for building analytical applications

49 lines 2.12 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); // (C) 2007-2020 GoodData Corporation var React = require("react"); var react_intl_1 = require("react-intl"); exports.getNumericSymbols = function (intl) { return [ "visualization.numericValues.k", "visualization.numericValues.m", "visualization.numericValues.g", "visualization.numericValues.t", "visualization.numericValues.p", "visualization.numericValues.e", ].map(function (id) { return intl.formatMessage({ id: id }); }); }; var TranslationsProvider = /** @class */ (function (_super) { __extends(TranslationsProvider, _super); function TranslationsProvider() { return _super !== null && _super.apply(this, arguments) || this; } TranslationsProvider.prototype.render = function () { var props = { numericSymbols: exports.getNumericSymbols(this.props.intl), emptyHeaderString: this.getEmptyHeaderString(), }; return this.props.children(props); }; TranslationsProvider.prototype.getEmptyHeaderString = function () { var emptyValueTranslation = this.props.intl.formatMessage({ id: "visualization.emptyValue" }); return "(" + emptyValueTranslation + ")"; }; return TranslationsProvider; }(React.PureComponent)); exports.TranslationsProvider = TranslationsProvider; exports.IntlTranslationsProvider = react_intl_1.injectIntl(TranslationsProvider); //# sourceMappingURL=TranslationsProvider.js.map