UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

23 lines 906 B
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import React from 'react'; import { useTranslate } from './useTranslate'; export var Translate = function (_a) { var i18nKey = _a.i18nKey, options = _a.options, children = _a.children; var translate = useTranslate(); var translatedMessage = translate(i18nKey, typeof children === 'string' ? __assign({ _: children }, options) : options); if (translatedMessage) { return React.createElement(React.Fragment, null, translatedMessage); } return children; }; //# sourceMappingURL=Translate.js.map