UNPKG

@gooddata/react-components

Version:
49 lines 1.91 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var 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 function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); exports.__esModule = true; var React = require("react"); var react_intl_1 = require("react-intl"); var enUS = require("../../../translations/en-US.json"); var deDE = require("../../../translations/de-DE.json"); var esES = require("../../../translations/es-ES.json"); var frFR = require("../../../translations/fr-FR.json"); var jaJP = require("../../../translations/ja-JP.json"); var nlNL = require("../../../translations/nl-NL.json"); var ptBR = require("../../../translations/pt-BR.json"); var ptPT = require("../../../translations/pt-PT.json"); exports.messagesMap = { 'en-US': enUS, 'de-DE': deDE, 'es-ES': esES, 'fr-FR': frFR, 'ja-JP': jaJP, 'nl-NL': nlNL, 'pt-BR': ptBR, 'pt-PT': ptPT }; exports.DEFAULT_LOCALE = 'en-US'; var IntlWrapper = /** @class */ (function (_super) { __extends(IntlWrapper, _super); function IntlWrapper() { return _super !== null && _super.apply(this, arguments) || this; } IntlWrapper.prototype.render = function () { var locale = this.props.locale; return (React.createElement(react_intl_1.IntlProvider, { locale: locale, messages: exports.messagesMap[locale] }, this.props.children)); }; IntlWrapper.defaultProps = { locale: exports.DEFAULT_LOCALE }; return IntlWrapper; }(React.PureComponent)); exports.IntlWrapper = IntlWrapper; //# sourceMappingURL=IntlWrapper.js.map