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

@ -244,7 +244,6 @@ module.exports = WithMatrixClient(React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Failed to kick"),
description: ((err && err.message) ? err.message : "Operation failed"),
button: _t("OK"),
});
}
).finally(()=>{
@ -287,7 +286,6 @@ module.exports = WithMatrixClient(React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
description: _t("Failed to ban user"),
button: _t("OK"),
});
}
).finally(()=>{
@ -338,7 +336,6 @@ module.exports = WithMatrixClient(React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
description: _t("Failed to mute user"),
button: _t("OK"),
});
}
).finally(()=>{
@ -388,7 +385,6 @@ module.exports = WithMatrixClient(React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
description: _t("Failed to toggle moderator status"),
button: _t("OK"),
});
}
}
@ -410,7 +406,6 @@ module.exports = WithMatrixClient(React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
description: _t("Failed to change power level"),
button: _t("OK"),
});
}
).finally(()=>{
@ -438,7 +433,7 @@ module.exports = WithMatrixClient(React.createClass({
if (parseInt(myPower) === parseInt(powerLevel)) {
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
Modal.createDialog(QuestionDialog, {
title: _t("Warning"),
title: _t("Warning!"),
description:
<div>
{ _t("You will not be able to undo this change as you are promoting the user to have the same power level as yourself") }.<br/>

View file

@ -127,7 +127,6 @@ export default class MessageComposer extends React.Component {
</ul>
</div>
),
button: _t("OK"),
onFinished: (shouldUpload) => {
if(shouldUpload) {
// MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file

View file

@ -507,7 +507,6 @@ export default class MessageComposerInput extends React.Component {
Modal.createDialog(ErrorDialog, {
title: _t("Server error"),
description: ((err && err.message) ? err.message : _t("Server unavailable, overloaded, or something else went wrong") + "."),
button: _t("OK"),
});
});
}
@ -517,7 +516,6 @@ export default class MessageComposerInput extends React.Component {
Modal.createDialog(ErrorDialog, {
title: _t("Command error"),
description: cmd.error,
button: _t("OK"),
});
}
return true;

View file

@ -297,7 +297,6 @@ export default React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Unknown command"),
description: _t("Usage") + ": /markdown on|off",
button: _t("OK"),
});
}
return;
@ -318,7 +317,6 @@ export default React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Server error"),
description: ((err && err.message) ? err.message : _t("Server unavailable, overloaded, or something else went wrong") + "."),
button: _t("OK"),
});
});
}
@ -328,7 +326,6 @@ export default React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Command error"),
description: cmd.error,
button: _t("OK"),
});
}
return;

View file

@ -122,7 +122,6 @@ module.exports = React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
description: _t("Failed to set avatar") + ".",
button: _t("OK"),
});
}).done();
},

View file

@ -59,7 +59,6 @@ const BannedUser = React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t('Error'),
description: _t('Failed to unban'),
button: _t("OK"),
});
}).done();
},
@ -530,7 +529,6 @@ module.exports = React.createClass({
Modal.createDialog(ErrorDialog, {
title: _t('Error'),
description: _t("Failed to forget room %(errCode)s", { errCode: errCode }),
button: _t("OK"),
});
});
},
@ -540,7 +538,7 @@ module.exports = React.createClass({
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
Modal.createDialog(QuestionDialog, {
title: _t('Warning') + '!',
title: _t('Warning!'),
description: (
<div>
<p>{ _t('End-to-end encryption is in beta and may not be reliable') }.</p>
@ -550,7 +548,6 @@ module.exports = React.createClass({
<p>{ _t('Encrypted messages will not be visible on clients that do not yet implement encryption') }.</p>
</div>
),
button: "OK",
onFinished: confirm=>{
if (!confirm) {
this.refs.encrypt.checked = false;