Put back default strings on dialogs

But make them work by calling _t in render rather than
getDefaultProps().

Also sort out some 'Warning!' strings
This commit is contained in:
David Baker 2017-05-25 18:20:48 +01:00
parent 9112fc231a
commit 443ab1add7
30 changed files with 31 additions and 78 deletions

View file

@ -27,6 +27,7 @@ limitations under the License.
import React from 'react';
import sdk from '../../../index';
import { _t } from '../../../languageHandler';
export default React.createClass({
displayName: 'ErrorDialog',
@ -44,6 +45,9 @@ export default React.createClass({
getDefaultProps: function() {
return {
focus: true,
title: null,
description: null,
button: null,
};
},
@ -57,13 +61,13 @@ export default React.createClass({
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
return (
<BaseDialog className="mx_ErrorDialog" onFinished={this.props.onFinished}
title={this.props.title}>
title={this.props.title || _t('Error')}>
<div className="mx_Dialog_content">
{this.props.description}
{this.props.description || _t('An error has occurred.')}
</div>
<div className="mx_Dialog_buttons">
<button ref="button" className="mx_Dialog_primary" onClick={this.props.onFinished}>
{this.props.button}
{this.props.button || _t('OK')}
</button>
</div>
</BaseDialog>