'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 __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var utils_1 = require("../../utils");
var functions_1 = require("../utils/functions");
// @deprecated. use DangerousHTML instead
var Translate = /** @class */ (function (_super) {
    __extends(Translate, _super);
    function Translate() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Translate.prototype.render = function () {
        var _a = this.props, children = _a.children, className = _a.className, testAutomationId = _a.testAutomationId, dataTestAutomationId = _a["data-test-automation-id"];
        //FIXME .toString() of children?
        return (react_1.default.createElement("span", { className: className, "data-test-automation-id": testAutomationId || dataTestAutomationId, dangerouslySetInnerHTML: { __html: utils_1.translate(children, this.props) } }));
    };
    Translate.propTypes = {
        children: prop_types_1.default.node.isRequired,
        className: prop_types_1.default.string,
        testAutomationId: prop_types_1.default.string
    };
    Translate.defaultProps = {
        className: null,
        testAutomationId: null
    };
    return Translate;
}(react_1.default.Component));
var DeprecatedTranslate = functions_1.deprecation(Translate, 'Use `DangerousHTML` component for inserting html or function `translate` for templates/pluralization.');
exports.Translate = DeprecatedTranslate;
//# sourceMappingURL=Translate.js.map