How to use the ra-core.translate function in ra-core

To help you get started, we’ve selected a few ra-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marmelab / react-admin / packages / ra-ui-materialui / src / layout / TitleDeprecated.js View on Github external
);
    }
    return React.cloneElement(title, { className, record, ...rest });
};

Title.propTypes = {
    defaultTitle: PropTypes.string.isRequired,
    className: PropTypes.string,
    locale: PropTypes.string,
    record: PropTypes.object,
    translate: PropTypes.func.isRequired,
    title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
};

export default translate(Title);
github bootstrap-styled / ra-ui / src / components / form / FormTab.js View on Github external
FormTab.propTypes = {
  className: PropTypes.string,
  children: PropTypes.node,
  context: PropTypes.oneOf(['header', 'content']),
  hidden: PropTypes.bool,
  icon: PropTypes.element,
  label: PropTypes.string.isRequired,
  path: PropTypes.string,
  translate: PropTypes.func.isRequired,
  value: PropTypes.string,
};

FormTab.displayName = 'FormTab';

export default translate(FormTab);
github marmelab / react-admin / packages / ra-ui-materialui / src / form / FormTab.js View on Github external
FormTab.propTypes = {
    className: PropTypes.string,
    contentClassName: PropTypes.string,
    children: PropTypes.node,
    intent: PropTypes.oneOf(['header', 'content']),
    hidden: PropTypes.bool,
    icon: PropTypes.element,
    label: PropTypes.string.isRequired,
    path: PropTypes.string,
    translate: PropTypes.func.isRequired,
    value: PropTypes.string,
};

FormTab.displayName = 'FormTab';

export default translate(FormTab);
github bootstrap-styled / ra-ui / src / components / layout / Title.js View on Github external
) : (
    React.cloneElement(title, { className, record, ...rest })
  );
  return ReactDOM.createPortal(titleElement, container);
};

Title.propTypes = {
  defaultTitle: PropTypes.string,
  className: PropTypes.string,
  locale: PropTypes.string,
  record: PropTypes.object,
  translate: PropTypes.func.isRequired,
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
};

export default translate(Title);
github bootstrap-styled / ra-ui / src / components / layout / DashboardMenuItem.js View on Github external
to="/"
    primaryText={translate('ra.page.dashboard')}
    leftIcon={}
    exact
    {...props}
  />
);

DashboardMenuItem.propTypes = {
  className: PropTypes.string,
  locale: PropTypes.string,
  onClick: PropTypes.func,
  translate: PropTypes.func.isRequired,
};

export default translate(DashboardMenuItem);
github bootstrap-styled / ra-ui / src / components / layout / TitleDeprecated.js View on Github external
);
  }
  return React.cloneElement(title, { className, record, ...rest });
};

Title.propTypes = {
  defaultTitle: PropTypes.string.isRequired,
  className: PropTypes.string,
  locale: PropTypes.string,
  record: PropTypes.object,
  translate: PropTypes.func.isRequired,
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
};

export default translate(Title);
github bootstrap-styled / ra-ui / src / components / list / FilterFormInput.js View on Github external
resource={resource}
      record={emptyRecord}
    />
    <div>&nbsp;</div>
  
);

FilterFormInput.propTypes = {
  filterElement: PropTypes.node,
  handleHide: PropTypes.func,
  resource: PropTypes.string,
  locale: PropTypes.string,
  translate: PropTypes.func,
};

export default translate(FilterFormInput);
github marmelab / react-admin / packages / ra-ui-materialui / src / detail / Tab.js View on Github external
: this.renderContent({ children, ...rest });
    }
}

Tab.propTypes = {
    className: PropTypes.string,
    contentClassName: PropTypes.string,
    children: PropTypes.node,
    context: PropTypes.oneOf(['header', 'content']),
    icon: ComponentPropType,
    label: PropTypes.string.isRequired,
    translate: PropTypes.func.isRequired,
    value: PropTypes.string,
};

export default translate(Tab);
github bootstrap-styled / ra-ui / src / components / detail / Tab.js View on Github external
? this.renderHeader(rest)
      : this.renderContent({ children, ...rest });
  }
}

Tab.propTypes = {
  className: PropTypes.string,
  children: PropTypes.node,
  context: PropTypes.oneOf(['header', 'content']),
  icon: PropTypes.element,
  label: PropTypes.string.isRequired,
  translate: PropTypes.func.isRequired,
  value: PropTypes.string,
};

export default translate(Tab);
github marmelab / react-admin / packages / ra-ui-materialui / src / layout / UserMenu.js View on Github external
}}
                    open={open}
                    onClose={this.handleClose}
                &gt;
                    {Children.map(children, menuItem =&gt;
                        isValidElement(menuItem) ?
                        cloneElement(menuItem, { onClick: this.handleClose }) : null
                    )}
                    {logout}
                
            
        );
    }
}

export default translate(UserMenu);