You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
657 B

  1. import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
  2. import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
  3. import { useTranslation } from './useTranslation';
  4. export function Translation(props) {
  5. var ns = props.ns,
  6. children = props.children,
  7. options = _objectWithoutProperties(props, ["ns", "children"]);
  8. var _useTranslation = useTranslation(ns, options),
  9. _useTranslation2 = _slicedToArray(_useTranslation, 3),
  10. t = _useTranslation2[0],
  11. i18n = _useTranslation2[1],
  12. ready = _useTranslation2[2];
  13. return children(t, {
  14. i18n: i18n,
  15. lng: i18n.language
  16. }, ready);
  17. }