UNPKG

ra-core

Version:

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

18 lines 807 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Translate = void 0; const react_1 = __importDefault(require("react")); const useTranslate_1 = require("./useTranslate.cjs"); const Translate = ({ i18nKey, options, children }) => { const translate = (0, useTranslate_1.useTranslate)(); const translatedMessage = translate(i18nKey, typeof children === 'string' ? { _: children, ...options } : options); if (translatedMessage) { return react_1.default.createElement(react_1.default.Fragment, null, translatedMessage); } return children; }; exports.Translate = Translate; //# sourceMappingURL=Translate.js.map