fix(widget-list): add missing translations in widget list top bar (#5471) (#5679)

This commit is contained in:
Josian Godard
2021-08-04 13:56:38 +02:00
committed by GitHub
parent d15a0220ad
commit db560cc082
6 changed files with 26 additions and 14 deletions

View File

@ -65,6 +65,7 @@ class ObjectWidgetTopBar extends React.Component {
collapsed: PropTypes.bool,
heading: PropTypes.node,
label: PropTypes.string,
t: PropTypes.func.isRequired,
};
renderAddUI() {
@ -82,7 +83,9 @@ class ObjectWidgetTopBar extends React.Component {
return (
<Dropdown
renderButton={() => (
<StyledDropdownButton>Add {this.props.label} item</StyledDropdownButton>
<StyledDropdownButton>
{this.props.t('editor.editorWidgets.list.addType', { item: this.props.label })}
</StyledDropdownButton>
)}
>
{types.map((type, idx) => (
@ -99,7 +102,8 @@ class ObjectWidgetTopBar extends React.Component {
renderAddButton() {
return (
<AddButton onClick={this.props.onAdd}>
Add {this.props.label} <Icon type="add" size="xsmall" />
{this.props.t('editor.editorWidgets.list.add', { item: this.props.label })}
<Icon type="add" size="xsmall" />
</AddButton>
);
}